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="Roedy Green, post: 4219664"] When you use new, it must be followed by hard coded the name of the class. When you use newInstance, you can create the Class object with Class.forName so all you need is a string containing the class name. This is more general, but more convoluted than using new. When you use Class.forName, GENJAR or the like has no idea that the class need be included in the jar. All it sees is the string, not the class name. The class name does not exist until run time. This can be a good or bad thing. -- Roedy Green Canadian Mind Products [URL]http://mindprod.com[/URL] One of the great annoyances in programming derives from the irregularity of English spelling especially when you have international teams. I want to find a method or variable, but I don't know precisely how its is spelled or worded. English is only approximately phonetic. Letters are randomly doubled. The dictionary often lists variant spellings. British, Canadian and American spellings differ.I would like to see an experiment where variable names were spelled in a simplified English, where there were no double letters.I also think you could add a number of rules about composing variable names so that a variable name for something would be highly predictable. You would also need automated enforcement of the rules as well as possible. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Java
Class.forName().newInstance() vs new
Top