saurav
asked on
Java Random class..
Hi,
What do I need to import in a java program, to access the Random class of Java.
Here is my program:
public class Test1 {
public static void main(String args[])
{
Random r = new Random();
int p;
p = r.nextInt();
System.out.println(p);
}
}
The output says class Random() not found.
thanks,
saurav
What do I need to import in a java program, to access the Random class of Java.
Here is my program:
public class Test1 {
public static void main(String args[])
{
Random r = new Random();
int p;
p = r.nextInt();
System.out.println(p);
}
}
The output says class Random() not found.
thanks,
saurav
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
saurav