This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Marcus Green #3 Question 46 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Marcus Green #3 Question 46" Watch "Marcus Green #3 Question 46" New topic
Author

Marcus Green #3 Question 46

John Towell
Greenhorn

Joined: Jul 26, 2002
Posts: 20
Question 46)
Which of the following statements are true?
1) A method cannot be overloaded to be less public in a child class
2) To be overridden a method must have the same name and parameter types
3) To be overridden a method must have the same name, parameter and return types
4) An overridden method must have the same name, parameter names and parameter types
Answer 3.
Answer 2 is technically a correct statement right? It doesn't say that "it ONLY needs to have same name and parameter types"
Paul Villangca
Ranch Hand

Joined: Jun 04, 2002
Posts: 133
Hi John,
In these types of questions, you're supposed to choose the best, or most accurate, option, since you're only asked for a single answer. Option (3) is the most accurate, therefore is the correct answer. Granted, the option is possibly correct, but an identical return type is required for an overriden method, and option (3) fits the bill.
Hope this helps,
Paul Villangca
John Towell
Greenhorn

Joined: Jul 26, 2002
Posts: 20
The question asks which of the following statementS are true. Meaning it could be more than one. I think the answer should be 2 and 3.
Paul Villangca
Ranch Hand

Joined: Jun 04, 2002
Posts: 133
Oops! My bad. The answer can be 2. In any case, you shouldn't worry about these types of questions appearing on the exam itself, since the number of correct answers are specified.
Thanks,
Paul
Marcus Green
arch rival
Rancher

Joined: Sep 14, 1999
Posts: 2813
Many thanks for he feedback, I have updated that question to the word "only" in option 2. I am trying to work the ambiguity out of my questions, which is a surprisingly hard thing to do but it is made much easier with feedback and discussion from others. Thanks again.
Marcus


SCWCD: Online Course, 50,000+ words and 200+ questions
http://www.examulator.com/moodle/course/view.php?id=5&topic=all
 
wood burning stoves
 
subject: Marcus Green #3 Question 46
 
Similar Threads
Overridden Method in 1.5
Examulator Question
overriding access
Doubt on Marcus Green's Mock Answers
Marcus Mock Exam No: 3 question 46