Vehiclehas a method drive()that throws an exception.
Caroverrides a method Vehicle drive()using its own method drive(), which does not throw an exception.
, , , , Vehicle v , , , v.drive(), , Car drive.
, v :
Vehicle v;
if(rand(0,1) == 1)
v = new Car();
else
v = new Vehicle();
, v . , .