1z0-819 Exam QuestionsBrowse all questions from this exam

1z0-819 Exam - Question 97


Given:

Which three classes successfully override showFirst()? (Choose three.)

Show Answer
Correct Answer: ABE

To successfully override the showFirst() method from the AdaptorFirst interface, the method must match the signature provided in the interface, which includes the method name and return type. Option A provides a concrete implementation of the showFirst() method, matching the signature. Option B, although abstract, correctly declares the showFirst() method, requiring any concrete subclass to implement it. Option E also provides a concrete implementation matching the interface's method signature. Therefore, options A, B, and E are correct answers.

Discussion

2 comments
Sign in to comment
StavokOptions: ABE
Jul 18, 2023

The three classes that successfully override the showFirst() method are A, B, and E. Option A is correct because it provides a concrete implementation of the showFirst() method as required by the AdaptorFirst interface. Option B is correct because it declares the showFirst() method as abstract, which means that any concrete subclass of MainClass must provide an implementation of the showFirst() method. Option E is correct because it provides a concrete implementation of the showFirst() method as required by the AdaptorFirst interface.

d7bb0b2
Jan 8, 2024

To complement: C: not override because methos return a String D: even not compile, because class not abstract cannot contain methods abstract (without body F: is no valid because is less restritive that the method So A B and E are correct

ASPushkinOptions: AB
Jun 20, 2024

Implementation and overriding are not the same thing. overriding (redefining the behavior of a method) and implementing (satisfying specific type constraints of a method) In fact, only case A is the overriding. -------- C Failed Failed it will not work for "void" it will work if interface AdapterFirst { Object showFirst(); } ------- B,E - ok it is possible to mark the class without an abstract methods as abstract ------- F Failed method overriding access must not make more restrictive (can be less restrictive)

ASPushkin
Jun 21, 2024

answer : ABE