If you want ot generate Random Numbers from 1 to 50 so, you should write in a way Starting No+Math.random()*Difference for e.g, int i = (int)(1+Math.random()*50); system.out.println("Random Numbers are"+i);
aarijmh Welcome to the Java Ranch, we hope you�ll enjoy visiting as a regular, however your name is not in keeping with naming policy the here at the ranch. Please re-register under an appropriate name as shown in the policy. Thanks again and we hope to see you around the ranch!!
------------------ Dave Sun Certified Programmer for the Java� 2 Platform