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="Joshua Cranmer, post: 4219508"] One particular difference is that, as new uses a class already in the constant pool, the lookup only needs to be done at most once per file, since it is otherwise indexed by an integer into a cache. Class.forName will have a slightly more expensive lookup, since it needs to index a hashtable by a String. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Java
Class.forName().newInstance() vs new
Top