The following code snippet will result in a run-time:
class Vehicle { public void printSound() { System.out.print(\"vehicle\"); } } class Ca
No. v is a Vehicle and it might be possible to cast it to Bike. It's not the compiler's job to figure out the actual runtime types of every object (especially because sometimes that's impossible).
v
Vehicle
Bike