• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

final

 
Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
josephine chen
Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Even I am not able to find the mock 3 exam site but
I have the print out .
reply
    Bookmark Topic Watch Topic
  • New Topic