Link to home
Start Free TrialLog in
Avatar of saurav
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                                                
ASKER CERTIFIED SOLUTION
Avatar of sgoms
sgoms

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of saurav
saurav

ASKER

Thank you very much...
saurav