Question 8
Not yet
answered
Flag question
Which statement is true about the following code?
abstract class Vehicle {
abstract void start();
}
class Car extends Vehicle {
void start() {
System.out.println("Car starts");
}
}
public class Main {
public static void main(String[] args) {
Vehicle v = new Car();
v.start();
}
a.
Car starts will be printed.
O b. The program will compile but not print anything.
c. The program will compile but throw a runtime exception.
O d. Vehicle v = new Car(); will cause a compilation error.