• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Inner Classes

 
Vicken Karaoghlanian
Ranch Hand
Posts: 522
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Vicky Nag
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 522
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 522
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you might want to disregard my question cause i figured it out
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic