You are getting a reference to the class Test. This is a static
reference to it.
kilgroja@netsc
ape.net (Jason To: "JDJList"
<[EMAIL PROTECTED]>
Kilgrow) cc:
Subject: [jdjlist] RE: Classloader is
null
05/24/02 11:30
AM
Please respond
to "JDJList"
I'm not sure what it is you are getting from "Test.class". It must be a
type Class but I don't see where the "class" property is documented.
What version of the jdk are you using?
RAMESH VISHNUVARDHAN <[EMAIL PROTECTED]> wrote:
>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
>
__________________________________________________________________
Your favorite stores, helpful shopping tools and great gift ideas.
Experience the convenience of buying online with Shop@Netscape!
http://shopnow.netscape.com/
Get your own FREE, personal Netscape Mail account today at
http://webmail.netscape.com/
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