Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

newInstance & constructor of base class

807569May 15 2006 — edited May 15 2006
When I instantiate a sub class directly (using new), the code in the constructor method of both base and sub classes run.

When I instantiate using java.lang.reflect.Constructor.newInstance, only the sub class's constructor method is invoked. Is there a way to force running the constructor method of the base class as well?

Thanks & Regards.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 12 2006
Added on May 15 2006
8 comments
538 views