Answer Posted / naresh
/**
* Returns the <code>Class</code> object associated with
the class or
* interface with the given string name. Invoking this
method is
* equivalent to:
*
* <blockquote><pre>
* Class.forName(className, true, currentLoader)
* </pre></blockquote>
*
* where <code>currentLoader</code> denotes the defining
class loader of
* the current class.
*
* <p> For example, the following code fragment returns the
* runtime <code>Class</code> descriptor for the class named
* <code>java.lang.Thread</code>:
*
* <blockquote><pre>
* Class t = Class.forName("java.lang.Thread")
* </pre></blockquote>
* <p>
* A call to <tt>forName("X")</tt> causes the class named
* <tt>X</tt> to be initialized.
*
* @param className the fully qualified name of
the desired class.
* @return the <code>Class</code> object for the
class with the
* specified name.
* @exception LinkageError if the linkage fails
* @exception ExceptionInInitializerError if the
initialization provoked
* by this method fails
* @exception ClassNotFoundException if the class cannot
be located
*/
public static Class<?> forName(String className)
throws ClassNotFoundException {
return forName0(className, true,
ClassLoader.getCallerClassLoader());
}
Source: Source code copied from Class class of JDK 1.6.
Hope this would be useful.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
For which statements does it make sense to use a label?
What is the highest-level event class of the event-delegation model?
Explain about thread synchronization inside a monitor?
Explain the difference between object state and behavior?
how i secure my site with the https protocol.what are the steps?
What is ripple effect?
Explain about RMI Architecture?
How database connectivity in XML is achieved?
What is JTS?
To identify IDL language what mapping mechanism is used?
What is the infobus?
What is the difference between session and entity beans?
What is abstract schema?
What is prototype?
What is the map interface?