• 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
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

mock question

 
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
select the true statement
source testcafe
a) transient method cannot be overridden
b) A final class may not be subclass
c) a private method can never be overridden to become public
d) a final method may not be overridden
ans is b and d

I have a doubt between may and always
thanks in advance
 
Ranch Hand
Posts: 621
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi V Gala


Even i got confused after reading

A final class may not be subclassed

but what actualy is.........

final class alaways cannot
be subclassed right isnt it?




then it leads to some meaning isnt it?

May be it sounds different but leads to
something meaningful................

I hope it helps.........!!!





Preparing SCJP 1.5
 
V Gala
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Final class cannot be subclass

why option 3 is false
 
Ranch Hand
Posts: 274
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by V Gala:
Final class cannot be subclass

why option 3 is false



Option 3: "a private method can never be overridden to become public"

is false because the private methods are not visible in a child class, so if something is not visible you cannot override it.
 
It's fun to be me, and still legal in 9 states! Wanna see my tiny ad?
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic