aspose file tools*
The moose likes Java in General and the fly likes Inner Class concept Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic
Author

Inner Class concept

harsh sahay
Greenhorn

Joined: May 13, 2011
Posts: 13

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>>


OCPJP6
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14350
    
  22

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.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Inner Class concept