public class Main {
public static void main(String[] args) {
Vehicle vehicle = new Vehicle();
vehicle = (car) Vehicle;
}
}
class Vehicle {
static void transport() {
}
}
class Car extends Vehicle {
int age;
String brand;
}
i understand that java implicitly upcasts, but I want to downcast this Vehicle instance and make it a Car. what am i doing wrong?