answer: EBC
E correct
the signature of the implementation method must be the same
the return type must be compatible(covariant) between the implementation and interface methods
--
B correct
because of E
--
C correct
return new B(str)
Abstract classes cannot be instantiated
B. A cannot be final (So B in impl throw compilation error because B cannot extends A)
C. B cannot be abstract (so cannot do new B()).
E. B is subclass of A (method is overriding so then => B is A
The correct answers are B. A cannot be final, C. B cannot be abstract, and E. B is a subtype of A.
Since the code compiles correctly, the method build in the BuilderImpl class must be a valid implementation of the method declared in the Question70 interface. This means that the return type of the build method in the BuilderImpl class, which is B, must be a subtype of the return type of the build method in the Builder interface, which is A. Therefore, option E is correct.
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.
ASPushkin
6 months, 2 weeks agomendjijet
12 months agod7bb0b2
1 year agod7bb0b2
1 year, 1 month agoStavok
1 year, 6 months agoMukes877
1 year, 7 months agoAdel2023
1 year, 8 months agoxuancat
1 year, 8 months ago