This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Java in General and the fly likes How to call nested classes inside constructor? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to call nested classes inside constructor?" Watch "How to call nested classes inside constructor?" New topic
Author

How to call nested classes inside constructor?

Michael Lars
Greenhorn

Joined: May 12, 2012
Posts: 20

Hello!

Maybe I don't have formulated the question correctly, but what i want to do is:

Product p = new C1(C2(C3(obj)));

where (classes) C1,C2,C3 are not ordered (can be random or repetitive)!

How can i do this on run-time?

Thank you!
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3720
    
  16
The new only applies to your C1 object. If you want to create the other objects as well you need something like this


Joanne
Michael Lars
Greenhorn

Joined: May 12, 2012
Posts: 20

Thank you!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to call nested classes inside constructor?