-----------------------------------------------------------------------------
forName
Throws:
LinkageError - if the linkage fails
ExceptionInInitializerError - if the initialization provoked by this method fails
ClassNotFoundException - if the class cannot be located
-----------------------------------------------------------------------------
Ernest Friedman-Hill wrote:The class name needs to be a fully-qualified name (e.g., "com.whatever.Foo") and the class file needs to available to the application classloader (i.e., on the class path.) If you meet both of these criteria, then it'll work; if you don't, then it won't.
pritam mugal wrote:
Is that for this code to execute both of them should be in the same package or else I will have to provide the absolute path for the class of which object I am trying to create the object there?
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
pritam mugal wrote:once i seen about this is the best java forum on some ibm blog...