Exam 1z0-819 All QuestionsBrowse all questions from this exam
Question 97

Given:

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

    Correct Answer: A, B, E

    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
StavokOptions: ABE

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

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

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

answer : ABE