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 is the difference between the font and fontmetrics classes?
What are the design considerations while making a choice between using interface and abstract class?
Where we can write Rmi registry in the code, without having to write it at the command prompt?
AS a developer will u create a data source in connection pool? If so how will u do that, how to access the object from connection pool using IRAD tool?
Can constructors be synchronized in java?
what is meant by JRMP?
How would you create a button with rounded edges?
What is in-memory replication?
How database connectivity in XML is achieved?
What is the relationship between local interfaces and container-managed relationships?
What do you know about seam?
Can I run seam with jdk 1.4 and earlier?
Can I use multiple html form elements with the same name?
What is the difference between static and non-static with examples?
Explain the steps in details to load the server object dynamically?