Win a copy of The Java Performance Companion this week in the Performance forum!
    Bookmark Topic Watch Topic
  • New Topic

Inner Class concept

 
harsh sahay
Greenhorn
Posts: 13
Eclipse IDE Java Mac
  • Mark post as helpful
  • send pies
  • Report post to moderator
hi...I tried to create a simple MyOuter class which holds an inner class called MyInner. As expected, two .class files where created after compilation as shown below:-
public class MyOuter
{
class MyInner
{
MyInner()
{
}
}
}

class MyOuter$MyInner
{
MyOuter$MyInner(MyOuter paramMyOuter)
{
}
}

Can Someone please explain me as to why no constructor was created for MyOuter class as the compiler is supposed to insert it by default.
Secondly, what is the meaning of MyOuter paramMyOuter argument in MyOuter$MyInner constructor and how it helps.Please explain me the complete flow.
Thanks>>
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15367
40
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Report post to moderator
Welcome to the Ranch!

Please don't post the same question in multiple forums. I'll close this one, let's continue in your other post.
 
    Bookmark Topic Watch Topic
  • New Topic