• 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

help with an example test question

 
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is true? (Choose three)

A) A method with the same signature as a private final method in class Z can be implemented in a subclass of Z.
B) A final method in class Z can be abstract if and only if Z is abstract.
C) A protected method in class Z can be overriden by any subclass of Z.
D) A private static method can be called only within other static methods in class Z.
E) A non-static public final method in class Z can be overriden in any subclass of Z.
F) A public static method in class Z can be called by a subclass of Z without explicitly referencing the class Z.


The given answer is A,C,F

I say the answer is A,C,D,F !!

what do you think?
 
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
D is incorrect because static methods (private or otherwise) can also be called from non-static methods.
 
Ranch Hand
Posts: 1609
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rachel Glenn wrote:What is true? (Choose three)
D) A private static method can be called only within other static methods in class Z.

what do you think?



A non-static method may ALSO call a static method.
 
Rachel Glenn
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Akhilesh Trivedi wrote:

Rachel Glenn wrote:What is true? (Choose three)
D) A private static method can be called only within other static methods in class Z.

what do you think?



A non-static method may ALSO call a static method.




aaahhh!! thank you! makes sense!!!
 
Your buns are mine! But you can have this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic