This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Inner Classes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Inner Classes" Watch "Inner Classes" New topic
Author

Inner Classes

Vicken Karaoghlanian
Ranch Hand

Joined: Jul 21, 2003
Posts: 522
can i have three class inside each other (see code)??? if i can, then how can i access the inner class named 'Outer1'? how can i create objects?

Note: this code compiles without any error.


- Do not try and bend the spoon. That's impossible. Instead, only try to realize the truth. <br />- What truth? <br />- That there is no spoon!!!
Vicky Nag
Ranch Hand

Joined: Jul 02, 2003
Posts: 40
class Outer
{
public class Inner
{
public class InnerInner
{
}
}
class Outer
{
public class Inner
{
public class InnerInner
{
}
}
public static void main(String args[])
{
Outer.Inner.InnerInner in = new Outer(). new Inner(). new InnerInner();
}
}
Hope This Helps.
V
Vicken Karaoghlanian
Ranch Hand

Joined: Jul 21, 2003
Posts: 522
hi Vicky, thx for the reply, but i didn't got the part where:

i don't see any similarity with:

this code is for two nested classes.

can you please explain it more clearly (what is happening)? i'll really appreciate it.
Vicken Karaoghlanian
Ranch Hand

Joined: Jul 21, 2003
Posts: 522
you might want to disregard my question cause i figured it out
 
wood burning stoves
 
subject: Inner Classes
 
Similar Threads
inner, outer disturbance?????
innerclasses
'this' in a static nested class
Static Inner Class
Inner Class inside a method