Given:
interface Device { void doStuff(); } abstract class Electronic { void getPower() { System.out.print("plug in "); } } public class Computer extends Electronic implements Device { void doStuff() { System.out.print("show book "); } public static void main(String[] args) { new Computer().getPower(); new Computer().doStuff(); } //w w w.j a v a 2s . c o m }
Which are true?
Choose all that apply.
A is correct.
By default, an interface's methods are public so the Computer.doStuff
method must be public, too.
The rest of the code is valid.
B, C, D, and E are incorrect.