Re: Class.forName
От: bolshik Россия http://denis-zhdanov.blogspot.com/
Дата: 14.09.06 08:11
Оценка:
Здравствуйте, Palmovod, Вы писали:

P>Что происходит, когда выполняется Class.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

http://denis-zhdanov.blogspot.com
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.