Java - Constructors
Given these classes:
class Vehicle {
Vehicle() {
System.out.print("V");
}
}
class Car extends Vehicle {
Car() {
super();
System.out.print("C");
}
}
class SportsCar extends Car {
SportsCar() {
System.out.print("S");
}
}
public class Demo {
public static void main(String[] args) {
new SportsCar();
}
}
What is the output, and why does it appear in that order?