exam questions

Exam 1z0-819 All Questions

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

Exam 1z0-819 topic 1 question 202 discussion

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

Given:



and

public class Bar extends Foo { ... }

Which two statements are true if the method is added to Bar? (Choose two.)

  • A. public Collection foo (Collection arg) { ... } overrides Foo.foo.
  • B. public Collection foo(Stream arg) { ... } overloads Foo.foo.
  • C. public Iterable foo{Collection arg) { ... } overrides Foo.foo.
  • D. public Collection bar(Collection arg) { ... } overloads Foo.foo.
  • E. public List foo (Collection arg) { ... } overrides Foo.foo.
  • F. public Collection foo(Collection arg) { ... } overloads Foo.foo.
Show Suggested Answer Hide Answer
Suggested Answer: BE 🗳️

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
ASPushkin
7 months ago
answer : ABE The bytecode after compilation with type erasure contains only normal classes, interfaces and methods, ensuring that no new types are produced. public Collection foo(Collection arg) {...} A) correct B) correct different arguments so this overloads C) not correct Iterable is an interface so it is not a covariant type E) correct return type is a covariant to Collection F) not correct this is overrides see A
upvoted 2 times
d7bb0b2
6 months, 4 weeks ago
that is ok a : is override b : is overload e: is override (List is a subtype of Collection, rule of override )
upvoted 1 times
...
...
d7bb0b2
7 months ago
3 are valid: A: overload B: overrride C: overload
upvoted 1 times
d7bb0b2
6 months, 4 weeks ago
B: is overload sorry
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