Predict the output:
public class sookshmas 
{
synchronized void call()
{
for(int i = 1; i 3; i++)
System.out.print(i+" ");
}
}
class Test implements Runnable
{
sookshmas s = new sookshmas();
public static void main(String[] args) throws InterruptedException
{
new Thread(new Test()).start();
Thread.sleep(800);
new Thread(new Test()).start();
}
public void run()
{
s.call();
}
}

Posted on by