my dog learned polymorphism
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Difference between new and Class.newInstance()  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Difference between new and Class.newInstance()  " Watch "Difference between new and Class.newInstance()  " New topic
Author

Difference between new and Class.newInstance()

Rahul mir
Ranch Hand

Joined: Oct 31, 2012
Posts: 38

Hi,
please someone explain about newInstance() method.
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

here you go .

Plus, I think newInstance create an object with default constructor. if there is no default constructor it throws error.
 
Have you checked out Aspose?
 
subject: Difference between new and Class.newInstance()
 
It's not a secret anymore!