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