Programming Concepts using Java, End Term
Consider the Java code given below.
class Oven { public void heatingMethod() { System.out.println("Standard heating"); }
public void capacity() { System.out.println("Standard capacity"); }}class Microwave extends Oven { public void heatingMethod() { System.out.println("Microwave heating"); }}class ConvectionOven extends Oven { public void heatingMethod() { System.out.println("Convection heating"); } public void capacity() { System.out.println("Large capacity"); }}public class Test { static void show(Oven[] ovens) { for (int i = 0; i < ovens.length; i++) { ovens[i].heatingMethod(); ovens[i].capacity(); } } public static void main(String[] args) { Oven[] ovens = {new Microwave(), new ConvectionOven()}; // LINE 1 show(ovens); }}Choose the correct option.
Consider the Java code given below. class Oven { public void heatingMethod() { System.out.println("Standard heating"); } public void capacity() { System.out.println("Standard capacity"); } } class Microwave extends Oven { public void heatingMethod() { System.out.println("Microwave heating"); } } class ConvectionOven extends Oven { public void heatingMethod() { System.out.println("Convection heating"); } public void capacity() { System.out.println("Large capacity"); } } public class Test { static void show(Oven[] ovens) { for (int i = 0; i < ovens.length; i++) { ovens[i].heatingMethod(); ovens[i].capacity(); } } public static void main(String[] args) { Oven[] ovens = {new Microwave(), new ConvectionOven()}; // LINE 1 show(ovens); } } Choose the correct option. Figure from the original question paper Figure from the original question paper