Question 10
Consider the code given below.
interface Vehicle{ default void getNoOfWheels() { System.out.println("Has 2 Wheels"); } default void getFuelCapacity() { System.out.println("Capacity: 20L Petrol"); }}class ADMSBike implements Vehicle{ // LINE 1 public void getFuelCapacity() { System.out.println("No petrol needed"); }}class MaruthiCar implements Vehicle{ // LINE 2 public void getNoOfWheels() { System.out.println("Has 4 Wheels"); }}public class InterfaceTest { public static void main(String[] args) { Vehicle v[] = new Vehicle[2]; v[0] = new ADMSBike(); v[1] = new MaruthiCar(); for (int i = 0; i < v.length; i++) { v[i].getNoOfWheels(); v[i].getFuelCapacity(); } }}Choose the correct option.