Which Java code snippet correctly demonstrates polymorphism through method overriding?
Aclass Vehicle { void move() { System.out.println("Moving"); } } class Car extends Vehicle { void move(int speed) { System.out.println("Car moving at " + speed); } }
Bclass Vehicle { void move() { System.out.println("Moving"); } } class Car extends Vehicle { void move() { System.out.println("Car moving"); } }
Cclass Vehicle { void move() { System.out.println("Moving"); } } class Car extends Vehicle { void move() { System.out.println("Moving"); } void move(int speed) {} }
Dclass Vehicle { void move() { System.out.println("Moving"); } } class Car { void move() { System.out.println("Car moving"); } }