Which statements are true about the following code?
Choose all that apply
1: interface Printable { 2: public abstract void print(); 3: } 4: public interface Writable extends Printable { 5: public void write(); 6: }
print()
method. print()
and write()
methods. write()
method. C.
The code compiles without issue, so option A is wrong.
Option B is incorrect, since an abstract class could implement Printable without the need to override the print()
method.
Option C is correct; any class that implements Writable automatically inherits its methods, as well as any inherited methods defined in the parent interface. Because option C is correct, it follows that option D is incorrect.
Finally, an interface can extend multiple interfaces, so option E is incorrect.