60. Random class In java
//Random class
import java.util.*;
class random_class
{
public static void main(String[] args) {
Random obj = new Random();
System.out.println(obj.nextInt());
System.out.println(obj.nextInt(1000));
for (int i = 0; i < 10 ; i++ ) {
System.out.println(obj.nextInt());
}
}
}
OUTPUT:
-328552001
116
-2009740136
-1779883719
-188711011
1673762916
-243162010
46344096
-1823513727
-1413869968
249453090
1171725984
Comments
Post a Comment