Friday, April 12, 2019

Java Thread Example by implementing Runnable interface

public class cl implements Runnable{ 
public void run(){ 
System.out.println("thread is running..............................."); 

 
public static void main(String args[]){ 
cl ob=new cl(); 
Thread t1 =new Thread(ob); 
t1.start(); 
 } 




$javac cl.java
$java -Xmx128M -Xms16M cl
thread is running...............................

No comments:

Post a Comment