On Apr 20, 10:19 am, John Joseph <[email protected]> wrote:
> Hi  
>    I am doing Inner Class  program .
>    What I wanted is to create a Class which have another class second class 
> contains another class
> ie InerClass contains InnerInnerClass which Contains InnerInnerInnerClass
> I had created the Class and I am not getting any syntax error . But from the 
> “Main.java” I cannot create an object instance of  “InnerInnerClass” and  
> “InnerInnerInnerClass “.
>
The code you posted is not relevant to the problem, as it does not
show how you create the classes you want, but just how you define it.
>From what I see, there is nothing to say about it, it sounds good.
Basically to create an inner class, you first create a new instance of
the outer class, then you create a new instance of an inner class from
the instance of your outer class you've just created, and so on. The
outer class acts as a prefix to the inner class for all things related
to creation.
For example:

OuterClass oc = new OuterClass();
OuterClass.InnerClass ic = oc.new InnerClass();
etc, etc.


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to