Java Programming Tutorial - 30 - Array Elements as Counters
Top Comments
All Comments (317)
-
around 2:15 .. It doesn't loop it 1000 times it loops it 999 since you put roll<1000 with it starting at 1. If it was starting at 0 or roll<=1000 then it would be 1000 times.
-
this one's pretty cool :D thanks
-
@dragonthewatcher public static void wait (int n){ long time0,ttime1; time0=System.currentTimeMillis
(); do{ time1=System.currentTimeMillis (); } while (time1-time0<1000); } sorry about the dodgy formatting -
Face Frequency
1 182
2 182
3 161
4 167
5 154
6 153
i didnt get a 0...
-
im confused... how do i make a delay?i tried doing a for loop with for(int counter=0;counter<=99999999999
;counter++){ }
System.out.println("suddenly a hand shoots from the mist") but it still does it instantly....
-
@ThatRandomNoob They accomplish the same thing, the only difference is that Math.random does not need you to instantiate an object first (like rand) before you use it. The method .nextInt is a method of both the Random and Scanner classes. When used with the Scanner class, it looks for the next integer that the user input, but with the Random class, it generates a random integer within the range you gave.
-
What is the difference between the rand.nextInt(6) and Math.random*(6) ? Also what does the .nextInt method do, and can it be applied to anything else?
-
first i was learning c++, it took me forever to learn somting, then i met this tutorials, now i'm learning java, because it's a loth easyer to follow you, then a lame text!
thumps up if you have watched all the tutorials before this one
zaidalyafey 1 month ago 133
I remember when i was confused wit System.out.println....
blamsam001 3 months ago in playlist Java Programming Tutorials 89