Cyber Monday 2024! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Oracle Exam 1Z0-819 Topic 8 Question 88 Discussion

Actual exam question for Oracle's 1Z0-819 exam
Question #: 88
Topic #: 8
[All 1Z0-819 Questions]

Given:

and

Which two method definitions at line n1 in the Bar class compile? (Choose two.)

Show Suggested Answer Hide Answer
Suggested Answer: C, F

Contribute your Thoughts:

Emelda
3 months ago
I think option C will compile because it uses the correct parameter type and return type.
upvoted 0 times
...
Lonna
3 months ago
But options B and F use incorrect parameter types, so they won't compile.
upvoted 0 times
...
Nieves
3 months ago
Hold up, why isn't C correct? TreeSet is a subtype of Set, so that should work, right?
upvoted 0 times
...
Lonny
3 months ago
This question is making my brain hurt. I should have studied more for this exam.
upvoted 0 times
Terrilyn
3 months ago
Bob
upvoted 0 times
...
Ty
3 months ago
Alice
upvoted 0 times
...
...
Lucy
3 months ago
I'm pretty sure the answer is B and D. The return type can be a subclass of the declared type, and the parameter type can be a supertype or subtype.
upvoted 0 times
...
Alonso
3 months ago
I disagree, I believe options B and F will compile because they have the correct return types.
upvoted 0 times
...
Tuyet
3 months ago
Haha, whoever came up with these options is trying to trick us. I'm just going to guess and hope for the best.
upvoted 0 times
Delpha
3 months ago
I agree, those seem like the most likely choices.
upvoted 0 times
...
Delpha
3 months ago
I think options B and F will compile.
upvoted 0 times
...
...
Lonna
3 months ago
I think options A and E will compile because they both use the correct parameter types.
upvoted 0 times
...
Georgene
4 months ago
Wait, isn't D also correct? Object is a supertype of Integer, so that should compile too.
upvoted 0 times
...
Marilynn
4 months ago
The correct answer has to be B and E. The method signature has to use a covariant return type and the parameter type has to be a supertype or subtype of the declared type.
upvoted 0 times
Lore
3 months ago
And the parameter type has to be a supertype or subtype of the declared type.
upvoted 0 times
...
Teddy
3 months ago
Yes, you're right. The method signature needs a covariant return type.
upvoted 0 times
...
Micheal
3 months ago
I think the correct answers are B and E.
upvoted 0 times
...
...

Save Cancel
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77