Hi Eric,
This is what i did....
-------------
abstract class InnerTest
{
protected InnerTest(){}
private int x =6;
public static void main(String[] gea)
{
System.out.println("Just here to say sorry i cannot instantiate InnerTest"); // won't get printed
}
abstract void myPieceofCake(String cake);
void howToGetToInner(String takeInner)
{
System.out.println("Am I Inside howToGetToInner(string) method???");
InnerMost im = new InnerMost();
im.seeOuter();
}
class InnerMost implements java.io.Serializable
{
public void seeOuter(){ System.out.println("The value of 'x'is:"+x); }
}
}
public class TestAbsInner extends InnerTest
{
void myPieceofCake(String ake)
{
System.out.println("Ofcourse it is my piece of cake");
}
void toTakeInner(String test)
{
System.out.println("To get the innermethod of an abstract class");
howToGetToInner(test);
}
public static void main(String[] gea)
{
TestAbsInner tai = new TestAbsInner();
String test= "JavaRanch";
tai.myPieceofCake(test);
tai.toTakeInner(test);
}
}
-----------------
And the output which I got is this:
Ofcourse it is my piece of cake
To get the innermethod of an abstract class
Am I Inside howToGetToInner(string) method???
The value of 'x'is:6