aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes class 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 "class" Watch "class" New topic
Author

class

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Is a class subclass of itself?
Tony Alicea
Desperado
Sheriff

Joined: Jan 30, 2000
Posts: 3222
    
    5
Not in Java.


Tony Alicea
Senior Java Web Application Developer, SCPJ2, SCWCD
Gopinath Rajgopal
Ranch Hand

Joined: Jun 26, 2000
Posts: 31
The complete reference by Patrick Naughton says it is - ie. every class is a sub class of itself. Only a "strict" sub class of a class cannot include itself.
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
Different people in OOP have slightly different definitions of "subclass", but in this case the definition Naughton uses is not the one used in Java. The JLS has a precise definition of subclass which does not include the class itself - only other classes which are extended from it, and their "descendents". If you see the word "subclass" on the exam, you can assume this is the definition used.

"I'm not back." - Bill Harding, Twister
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Originally posted by Jim Yingst:
Different people in OOP have slightly different definitions of "subclass", but in this case the definition Naughton uses is not the one used in Java. The JLS has a precise definition of subclass which does not include the class itself - only other classes which are extended from it, and their "descendents". If you see the word "subclass" on the exam, you can assume this is the definition used.

Thanks! All for replying.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: class
 
Similar Threads
can non-static inner class access any member
Doubt about diagram class (realization)
andrew has wii
Doubt about diagram class
WA #1.....word association