Threads

Updated sri_jes13 0 Tallied Votes 134 Views Share

Hi this is a very simple program explaining of Threads using the runnable interface. I hope this will help in some other way.:)

public class ThreadTester
{
  public static void main(string args[])
   {
     Runnableex r=new Runnableex();
     Thread t=new Thread(e);
     t.start():
    
    )
}

class Runnableex implements Runnable
{
   int i;

   public void run()
    {
      i=0;
       while(true)
         {
           System.out.println("HELLO"+i++);
            if(i==50)
             {
               break;
             }
         }
    }
}
sri_jes13 0 Newbie Poster

thanks

finepax007 0 Newbie Poster
Runnableex r=new Runnableex();
Thread t=new Thread(r);
 t.start();
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.