Chair is a "class" implementing Movable, so Chair must implement all methods of Movable(Answer 4). Pay attention to the fact that when implementing m2(),m3() and m4() you cannot reduce their access visibility (must mark them public)
Another solution to resolve the errors, is to convert Chair to an "abstract class", which can choose what to implement from its super (Movable).
Answer 2, suggests marking Chair abstract and choosing not to implement m3() and m4() and implementing only m2(). But implementing m2() requires marking it public for the fact mentioned at the beginning.
|
Oracle Certified Professional Java Programmer
Author:
JavaChamp TeamSenior Java Developer
QuizOver.com
Germany
Access: |