This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Inquisition [0.14]- Exam Question - Requried Correct Answer. - overriding in static members. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Inquisition [0.14]- Exam Question - Requried Correct Answer. - overriding in static members." Watch "Inquisition [0.14]- Exam Question - Requried Correct Answer. - overriding in static members." New topic
Author

Inquisition [0.14]- Exam Question - Requried Correct Answer. - overriding in static members.

kaushik vira
Ranch Hand

Joined: Feb 01, 2007
Posts: 102


What class modifier(s) can be inserted at line 1 to prevent method() from being overridden (hidden ) without causing compile time errors ?

options are:-

  • transient
  • private
  • default
  • protected
  • hiding cannot be prevented
  • final


  • As per me there is no overriding in picture, as method is static.. so Answer should be hiding cannot be prevented. but simulator ans is Private
    Can any buddy explain.. how??/


    kaushik Vira
    -------------------------------------
    SCJP, Preparing SCWCD..
    Venkata Saraswathi
    Ranch Hand

    Joined: Sep 27, 2008
    Posts: 55
    I hope you can use private. Because private methods has class scope.

    --
    Venkata.
    kaushik vira
    Ranch Hand

    Joined: Feb 01, 2007
    Posts: 102
    Can any one having more detail Answer..
    Alexander Danilou
    Greenhorn

    Joined: May 08, 2009
    Posts: 28
    All I can add that private final is also going to be correct combination to add on line 1. It is not clear from the answer if we should chose one or several. To me this question is also unclear...
    kaushik vira
    Ranch Hand

    Joined: Feb 01, 2007
    Posts: 102
    hello Alexander ,

    Thanks for you efforts.. but in Inquisition simulator it`s like this only.. i am also confused
     
     
    subject: Inquisition [0.14]- Exam Question - Requried Correct Answer. - overriding in static members.
     
    Similar Threads
    static method hidden ?
    Static method modifier question
    Overriding static methods
    errata John Meyers Mock exam
    Static methods and instance variables are not overridden