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 Android Security Essentials Live Lessons this week in the Android 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.
 
Don't get me started about those stupid light bulbs.
 
subject: Difference between new and Class.newInstance()