Pages

Subscribe:

Ads 468x60px

4/15/11

Make a random value in Java

SO SAD!!! i have write my post for this title but suddenly my PC restarting itself and i must to write again... ugh,, so frustrating!!
But, fortunately i still save some data... Praise my Lord...
So, here is my program for generate a random value in java programing. i'll use an printscreen of my program and it's output.



and it's outputs for every running program is always difference because it's randoms behavior. like this :
second running

third running
so, if you want to generate a random value on java programing :
  • import java.util.*;
  • make an object from class Random :
 Random random = new Random() ;
  • and the syntax is :
individu[i][0][index]=random.nextInt(100);
means that generate an integer random value between 0 and 100.

1 comments:

ATokko Kidz said...

bagus blog nya,..
'kita tahu ada masalah,

kita tahu solusinya seperti apa.

Maka seharusnya kita berani berjuang dengan idealisme kita. Persetan dengan yang namanya realita'





Anonymous

( Someone at world wide web )

Post a Comment