• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Marcus Green #3 Question 46

 
John Towell
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2813
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic