Imagem de fundo

Considere o código seguinte:class Vehicle {String type = "Generic";String getType() {re...

Considere o código seguinte:


class Vehicle {

String type = "Generic";


String getType() {

return type;

}

}


class Car extends Vehicle {

String type = "Car";


String getType() {

return type;

}

}


public class Main {

public static void main(String[] args) {

Vehicle v = new Car();

System.out.println(v.getType());

}

}


O valor impresso será


A

Car


B

Generic


C

GenericCar


D

v.getType()


E

Ocorrerá erro de execução.