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

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic

Inner Class concept

harsh sahay

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

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.

Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14909

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
wood burning stoves
subject: Inner Class concept
It's not a secret anymore!