Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Java
Class.forName().newInstance() vs new
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Martin Gregorie, post: 4219459"] Is there actually that much difference? It strikes me that both 'new' and Class.forName() are doing essentially the same, namely searching the class path for the required class, loading it into the JVM and instantiating an object from it. I also wonder if 'new' might not be implemented as a wrapper for Class.forName(). It certainly could be done that way: both return a class object if they are successful and throw an exception if the class can't be found. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Java
Class.forName().newInstance() vs new
Top