class Threadtest
{ static StingBuffer str_1=new StringBuffer("");
static StingBuffer str_2=new StringBuffer("");
public static void main(
String args[]);
{final String str="";
new
Thread()
{pubic viod run()
{synchronized(str)
{str_1.append("A");
str_2.append("B");
System.out.priintln(str_2);
System.out.priintln(str_1;
}
}
}.start();
new Thread()
{pubic viod run()
{synchronized(str)
{str_2.append("C");
str_1.append("D");
System.out.priintln(str_1);
System.out.priintln(str_2);
}
}
}.start();
}
}
what may be the output of this code?
A.ABBCAD
B.BCBADD
C.CDDACB
D.BAADBC
E.DCDACB