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

final

josephine chen
Ranch Hand

Joined: Oct 29, 2002
Posts: 216
this is from marcus exam 3 says true
when applied to a class , the final modifiers means it cannot be subclassed ?
i feel that it can be subclassed but cannot have subclasses
ie
final class X extends Y{}//ok
class z extends X//wrong
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
final class X extends Y{}//ok
class z extends X//wrong
you are right, cannot subclass final classes. In u'r case
Class x is final which is a subclass of class Y but cannot have any subclass of class X.
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
When Marcus says that a final class cannot be subclassed, that means that it cannot have any subclasses. It says nothing about whether the final class is already a subclass of some other class (which it must be, if only of Object). If he'd said that a final class cannot be a subclass, then the statement would be incorrect. But "cannot be subclassed" means "you cannot extend a subclass from this one," nothing else.
Shan (or anyone else who knows)- what is the URL for Marcus' exam 3, anyway? It seems to have moved from where it was a couple months ago.


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

Joined: Oct 29, 2002
Posts: 216
Even I am not able to find the mock 3 exam site but
I have the print out .
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: final