Posts by user39733 • 135 points
2 posts
-
5
votes2
answers4930
viewsQ: What is the difference between Math.Random and java.util.Random?
What’s the difference in using the random without the import, right in the method. public class random { public static void main(String[] args) { int x = (int) (Math.random() * 10);…
-
8
votes2
answers784
viewsQ: printf in Java - What is %3d for?
I’m seeing a java arrays exercises, but I can’t understand what the %3d, if it’s a int. for (i=0; i<n; i++) { System.out.printf("a[%d] = %3d b[%d] = %3d\n", i, a[i], i, b[i]); }…