Well, God forbid you should check out the language specification and the
API, but here goes:
There is no instanceOf(). You MAY be thinking of instanceof, which is an
operator yielding a boolean; it's valuable for determining if a class is an
instance of a certain class or interface. (For example:
if(widget instanceof MyFooClass) { System.out.println("We have a foo!"); }
newInstance() is valuable for calling the null-argument constructor of a
class. You can read the API docs for this, in the java.lang.Class class.
Usage is something like this:
Class fooclass=Class.forName("MyFooClass");
Object foo=fooclass.newInstance();
>From: "Dinesh Ramaswamy" <[EMAIL PROTECTED]>
>Reply-To: "JDJList" <[EMAIL PROTECTED]>
>To: "JDJList" <[EMAIL PROTECTED]>
>Subject: [jdjlist] Purpose of instanceOf() and newInstance() in java
>Date: Sat, 28 Sep 2002 16:59:01 +0530
>
>Can someone say me the exact purpose of instanceOf() and newInstance() in
>java?
>Regards,
>Dinesh.
>
>
>
>____________________________________________________
>To change your JDJList options, please visit:
>http://www.sys-con.com/java/list.cfm
>
>Save Bandwidth! Clean up your posts before replying
>____________________________________________________
-----------------------------------------------
Joseph B. Ottinger [EMAIL PROTECTED]
http://enigmastation.com IT Consultant
_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx
____________________________________________________
To change your JDJList options, please visit:
http://www.sys-con.com/java/list.cfm
Save Bandwidth! Clean up your posts before replying
____________________________________________________