>

Wednesday, August 29, 2012

SImple Thread Program To Pause For Loop

class ThreadExample{
  public static void main(String args[])
   {
        Thread th=new Thread();
      try{
          for(int i=0;i<10;i++)
    {
                System.out.println(" Value "+i);
     th.sleep(2000);
              }
          }
           catch(Exception e)
    {
     System.out.println(" "+e.getMessage());
    }
    }
         }

No comments:

Post a Comment

Please post your comments. Your comments make us to write more programs for you.