Predict the output
public class BK implements Runnable
{
public void demo()
{
System.out.printf(" Code works fine!! ");
}
try
{
public BK()
{
Thread.sleep(5000);
}
}
catch (InterruptedException e)
{
e.printStackTrace();
}
public static void main(String[] args)
{
BK b = new BK();
Thread thread = new Thread(obj);
thread.BK();
System.out.printf("Strive towards perfection");
}
}



Posted on by