Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

help with an example test question

 
Rachel Glenn
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • 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?
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
D is incorrect because static methods (private or otherwise) can also be called from non-static methods.
 
Akhilesh Trivedi
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
  • 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
  • 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!!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic