4, ఏప్రిల్ 2012, బుధవారం

ACCESSING OF THE JAVA LIBRARY A SAMPLE CODE


import java.util.*;
class random 
{
public static void main(String args[])       
{
       try
       {
    while(true)
        {
int r=(int)(Math.random()*51);
//if(r==0)
//break;
System.out.print("the next random number is                                              "+r);
Thread.sleep(1000);
}}
catch(Exception e){}
}}

OUTPUT LIKE THIS :-                            
                           27the next random number is
                                  43the next random number is
                                      20the next random number is
                                          20the next random number is


కామెంట్‌లు లేవు:

కామెంట్‌ను పోస్ట్ చేయండి