Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeds.phibee-telecom.net!usenet.ukfsn.org!not-for-mail From: Martin Gregorie Newsgroups: comp.lang.java.programmer Subject: Re: Class.forName().newInstance() vs new Date: Sun, 12 Jun 2011 14:37:39 +0000 (UTC) Organization: UK Free Software Network Lines: 19 Message-ID: References: <95ho4qFd7cU1@mid.individual.net> <95jod7FbdbU1@mid.individual.net> <1NGdnZX1kJp-VWnQnZ2dnUVZ_oGdnZ2d@earthlink.com> NNTP-Posting-Host: 84.45.235.129 Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: localhost.localdomain 1307889459 27470 84.45.235.129 (12 Jun 2011 14:37:39 GMT) X-Complaints-To: usenet@localhost.localdomain NNTP-Posting-Date: Sun, 12 Jun 2011 14:37:39 +0000 (UTC) User-Agent: Pan/0.133 (House of Butterflies) Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:5239 On Sun, 12 Jun 2011 07:10:07 -0700, Patricia Shanahan wrote: > Is there really any program that instantiates so many database managers > that the difference between newInstance and constructor, and the > pipeline reloads related to conditional branches, become measurable? > 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. -- martin@ | Martin Gregorie gregorie. | Essex, UK org |