Answer Posted / amit beriwal
forName
public static Class forName(String className)
throws ClassNotFoundException
Returns the Class object associated with the class or
interface with the given string name. Invoking this method
is equivalent to:
Class.forName(className, true, currentLoader)
where currentLoader denotes the defining class loader of
the current class.
For example, the following code fragment returns the
runtime Class descriptor for the class named java.lang.Thread:
Class t = Class.forName("java.lang.Thread")
A call to forName("X") causes the class named X to be
initialized.
Parameters:
className - the fully qualified name of the desired
class.
Returns:
the Class object for the class with the specified name.
Throws:
LinkageError - if the linkage fails
ExceptionInInitializerError - if the initialization
provoked by this method fails
ClassNotFoundException - if the class cannot be located
Source:-http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Class.html#forName%28java.lang.String%29
| Is This Answer Correct ? | 8 Yes | 0 No |
Post New Answer View All Answers
What must a class do to implement an interface?
whats is statement and procedure
What is the purpose of the notifyall() method?
What is prototype?
Is jvm a overhead?
What are the services in RMI ?
What is the purpose of the wait() method?
Can I run seam outside of jboss as?
How would you create a button with rounded edges?
What is an abstract method?
Do we need to override service() method
What are callback interfaces?
What if the static modifier is removed from the signature of the main method?
how to use debug in my elipse to solve problems that exist in my project
Do I have to use jsps with my application?