Alan Couze wrote:I understand that 'C' is a correct answer, since there is an invalid override (more restrictive access modifier in the class is defined).
Alan Couze wrote:Answer 'D' does not seem to be a correct answer. The explanation says "Next, the class Cougar implements an overloaded version of getTailLength(), but since the declaration in the parent class Puma is invalid, it needs to implement a public version of the method. Since it does not, the declaration of Puma is invalid, so option D is correct." However, class Cougar does implement a public version of getTailLength().
Alan Couze wrote:'E' seems to be a correct answer, however the answer section says "Option E is incorrect, since Puma is marked abstract and cannot be instantiated." Shouldn't it say "Option E is correct"?
Alan Couze wrote:So I believe that C,E are correct answers, but D is not.
Alan Couze wrote:I see what I did wrong. I missed the fact that the getTailLength(int) is an overloaded method - I missed the int parameter!
Roel De Nijs wrote:
Jeanne Boyarsky wrote:I've updated the errata list for both.
Should also be added to the "online materials" section as the assessment test can be taken online as well...
Jeanne Boyarsky wrote:Besides I'm going to report the online ones so eventually they won't be wrong anymore...
Daniele Barell wrote:I resurrect this thread because I got another doubt about this same question, that is the last possible option, the option G.
G: The output can't be determined from the code provided.
I don't understand why it is not considered a correct option.
In fact you could not determine what is the output of the code provided since the multiple errors in it.
Jeanne Boyarsky wrote:
"he output can't be determined from the code provided" - This means that the program runs successfully but you can't tell what the output is. That's something that happens with random numbers and threads. Neither of those are in exam scope for the OCA.
Jeanne Boyarsky wrote:...
"The output can't be determined from the code provided" - This means that the program runs successfully but you can't tell what the output is. That's something that happens with random numbers and threads. Neither of those are in exam scope for the OCA. This is an answer that makes sense for the OCP. We sprinkled it in some of the OCA questions so you get used to seeing it as an answer. It's pretty much guaranteed to be wrong on the OCA though!
Jeanne Boyarsky wrote:Ooh good one! ...Have a cow!