why the following code is not compiling?
class outer
{
String name="alpha";
class inner
{
String name="beta";
class innerinner
{
String name="gamma";
public void dosomething(){
System.out.println(name);
}
};
};
};
class
test {
public static void main(String args[]){
new outer().new childinner().dosomething();
}
};
class childinner extends outer.inner
{
String name="telta";
public void dosomething(){
System.out.println("name is "+outer.this.name);
System.out.println("2ns name is "+name);
System.out.println("3 rd name is "+ super.name);
}
};
Originally posted by Cindy Glass:
Well, it CAN be done, but I wouldn't do it. You can end up with all SORTS of strange behaviors.
Read this: http://www.javaranch.com/ubb/Forum34/HTML/000485.html