Upto my knowledge, the main class will be loaded by the bootstrap
classloader.When i execute the following code I get
sun.misc.Launcher$AppClassLoader@7fdcde. I think this is the bootstrap
classloader.
public class Test{
public static void main(String args[]) {
System.out.println(Test.class.getClassLoader());
}
}
-----Original Message-----
From: Fewtrell, Tom
To: JDJList
Sent: 5/24/02 5:05 PM
Subject: [jdjlist] RE: Classloader is null
The javadoc contains the following for Class's getClassLoader() method:
"Some implementations may use null to represent the bootstrap class
loader.
This method will return null in such implementations if this class was
loaded by the bootstrap class loader."
Is the bootstrap classloader used for Strings? or maybe something to do
with
bootstrapping for the main method?
-----Original Message-----
From: RAMESH VISHNUVARDHAN [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 24, 2002 3:48 PM
To: JDJList
Subject: [jdjlist] Classloader is null
Hi all,
I am executing the following code:
public class Test{
public static void main(String args[]) {
System.out.println(new String().getClass().getClassLoader());
}
}
I am getting the output as null. How can be a class without classloader?
Can
anybody explain why am i getting null.
Regards,
Vishnu
To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm
This e-mail and any attachment is for authorised use by the intended
recipient(s) only. It may contain proprietary material, confidential
information and/or be subject to legal privilege. It should not be
copied, disclosed to, retained or used by, any other party. If you are
not an intended recipient then please promptly delete this e-mail and
any attachment and all copies and inform the sender. Thank you.
To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm
To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm