Question 1
Consider the Java code given below.
interface Computable{ void compute();}class Phone implements Computable{ public void compute() { System.out.println("Phone compute"); }}class Laptop implements Computable{ public void compute() { System.out.println("Laptop compute"); }}class DeviceList{ private Object[] cArr = {new Phone(), new Laptop()}; public void getCompute(){ for(int i = 0; i < cArr.length; i++){ //LINE 1 } }}public class Test{ public static void main(String[] args) { DeviceList dList = new DeviceList(); dList.getCompute(); }}Identify the appropriate option to fill in place of LINE 1 such that the output is
Phone compute
Laptop compute