class Vehicle {
public void show() {
System.out.println("Parent");
}
}
class Car extends Vehicle{
public int show() {
System.out.println("Child");
return 3;
}
}
When I am trying to override Car class' method in child class, it is showing error but when I specify a parameter in the method, the error goes away.