Hi All,
Can anyone please explain me the flow diagram for the code below.I am not able to understand why a null pointer exception is thrown at m5.go();
This one is from K &B Chapter 3 pg:261
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.println("Hi");
}
}