exam questions

Exam 1z0-819 All Questions

View all questions & answers for the 1z0-819 exam

Exam 1z0-819 topic 1 question 166 discussion

Actual exam question from Oracle's 1z0-819
Question #: 166
Topic #: 1
[All 1z0-819 Questions]

Given:



and



and



Which three are true? (Choose three.)

  • A. f1.foo(c) prints Hello world!
  • B. f2.foo(c) prints Olá Mundo!
  • C. f1.foo(c) prints Bonjour le monde!
  • D. f2.foo(c) prints Bonjour le monde!
  • E. b1.foo (c) prints Olá Mundo!
  • F. f2.foo(c) prints Hello world!
  • G. f1.foo(c) prints Olá Mundo!
  • H. b1.foo(c) prints Bonjour le monde!
  • I. b1.foo(c) prints Hello world!
Show Suggested Answer Hide Answer
Suggested Answer: CFI 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
cathDev
3 months ago
Selected Answer: CFI
Tested really CFI
upvoted 1 times
...
d7bb0b2
6 months, 1 week ago
Selected Answer: CFI
C F and I are correct E is not correct
upvoted 1 times
...
dilleman
9 months, 2 weeks ago
Selected Answer: CFI
Tested, C F I is correct.
upvoted 1 times
...
Ashan_Ozlov
9 months, 3 weeks ago
Selected Answer: CFI
Tested
upvoted 1 times
...
[Removed]
10 months, 2 weeks ago
Selected Answer: CFH
E is incorrect because The reference type 'Collection' is what decides which method gets called.
upvoted 1 times
[Removed]
10 months, 2 weeks ago
Which cannot invoke a method with List parameter type.
upvoted 1 times
...
...
Stavok
11 months, 4 weeks ago
Selected Answer: CEF
f1.foo(c) calls the foo() method on the f1 object, which is an instance of the Foo class. This method prints "Bonjour le monde!", so C is true.f2.foo(c) calls the foo() method on the f2 object, which is an instance of the Bar class. Since f2 is declared as a Foo object, the foo() method from the Foo class is overridden by the foo() method from the Bar class that takes a Collection argument. This method prints "Hello world!", so F is true.b1.foo(c) calls the foo() method on the b1 object, which is an instance of the Bar class. Since b1 is declared as a Bar object and the argument passed to the method is a List, the most specific version of the overloaded foo() method from the Bar class that takes a List argument is called. This method prints "Ola Mundo!", so E is true.
upvoted 1 times
...
belal97
1 year ago
CDI correct
upvoted 1 times
...
belal97
1 year ago
Selected Answer: CEF
foo f1 = new foo(); => foo class has one method print hello world foo f2 = new bar(); f2 cant access overload method in bar so print ponjour bar b1 = new bar() ; b1 can access two method but we pass arrayList so print ola
upvoted 1 times
KiraguJohn
1 year ago
b1 will take the foo with collection not the one with arrayList. Just tested
upvoted 1 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago