Given:.
class Printer {//from ww w . j a v a 2 s .co m protected int print(int x) { return x * 2; } } class Shape { void go(Printer m) { System.out.print(m.print(21) + " "); } } public class Main extends Printer { public static void main(String[] args) { System.out.print(new Main().print(11) + " "); new Shape().go(new Main()); new Shape().go(new Printer()); } int print(int x) { return x * 3; } }
What is the result? (Choose all that apply.)
E is correct.
Main.print()
will not compile because it's attempting to override using a weaker access modifier.