In your second code sample,
Vehicle#getType() returns a
Vehicle. Since
Car extends
Vehicle -- every
Car is-a Vehicle -- you can't override the method to return
String; the returned type must be a
Vehicle (which includes any subclass of
Vehicle, which as said,
is-a Vehicle). And a
String is definitely not a
Vehicle.
See the
Requirements in Overriding and Hiding in the JLS. Actually, it would be worth your while to go through that entire chapter.