File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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: 3506
    
  14
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!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to call nested classes inside constructor?