class A implements Runnable
{
public void run()
{
for(int i=0;i<5;i++)
{
try
{
Thread.sleep(500);
System.out.println("Hello");
}
catch(Exception e){}
}
}
}
class B
{
public static void main(String... args)
{
A x=new A();
Thread t1=new Thread(x);
t1.start();
}
}
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter