Hi Ranchers!
class Mixer{
Mixer(){ }
Mixer(Mixer m) { m1=m ;}
Mixer m1;
public static void main(
String[] args){
Mixer m2= new Mixer();
Mixer m3= new Mixer(m2);
m3.go();
Mixer m4=m3.m1;
m4.go();
Mixer m5=m2.m1; m5.go();
}
void go()
{ System.out.print("hi");}
}
Output: hi hi, followed by an exception
Friends ,please help me in understanding the output.I couldn't.
Source:
SCJP guide 6.0(K and B), page 270, Q4.
Thanks in advance
[ December 20, 2008: Message edited by: Raj kumar ]