Hi,
Try this peice of code to follow the logic behind the calling of
method A in obj 2 and thecalling of main method in obj1
cheers
Gayathri
public class obj11
{
int i =2;
public static void main(String args[])
{
int j=2;
System.out.println("In main");
obj11.obj2 o2 = new obj11().new obj2();
o2.methodA();
System.out.println(o2.h);
}
class obj2
{
String h ="Hello";
void methodA()
{
String s = "Java ";
System.out.println(h+s+i);
}
}
}
class obj3 extends obj11
{
static
{
System.out.println("Inside Static");
obj11.obj2 o4= new obj11().new obj2();
o4.methodA();
}
}