aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes instaceof Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "instaceof" Watch "instaceof" New topic
Author

instaceof

Sefa Urgenc
Ranch Hand

Joined: Jul 25, 2002
Posts: 34
Hi everyone,
I was wondering why the instanceof of operator is not compiling in the following code.

Thanx in Advance
Richard Jensen
Ranch Hand

Joined: May 14, 2003
Posts: 67
Originally posted by Sefa Urgenc:
I was wondering why the instanceof of operator is not compiling in the following code.

Thanx in Advance

instanceof works on an object, not a class. So first you would need a subclass of A (so you can instantiate an object--A is abstract) and then you would need to create the object.

And then your main would look like:


Richard
N 37 33 W 122 18
Sefa Urgenc
Ranch Hand

Joined: Jul 25, 2002
Posts: 34
Thanks, I totally forgot about that, my bad.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: instaceof