nerdexam
Oracle

1Z0-819 · Question #17

Given: ``java public interface Builder { public A build(String str); } ` and `java public class BuilderImpl implements Builder { @Override public B build(String str) { return new B(str); } } ``…

The correct answer is A. B cannot be abstract. B. B is a subtype of A. D. B cannot be final. See the full explanation below for the reasoning.

Question

Given:
public interface Builder {
 public A build(String str);
}
and
public class BuilderImpl implements Builder {
 @Override
 public B build(String str) {
 return new B(str);
 }
}
Assuming that this code compiles correctly, which three statements are true? (Choose three.)

Options

  • AB cannot be abstract.
  • BB is a subtype of A.
  • CA cannot be abstract.
  • DB cannot be final.
  • EA is not final.
  • FA is a subtype of B.

How the community answered

(28 responses)
  • A
    82% (23)
  • C
    7% (2)
  • E
    7% (2)
  • F
    4% (1)

Community Discussion

No community discussion yet for this question.

Full 1Z0-819 Practice