We may encounter this error message when we override a superclass method in the subclass with a wrong return type in the subclass method. To understand this, let's see the following two classes.
public class SuperClass
{
public double sum(double a,double b)
{
return (a+b);
}
}
public class Subclass extends SuperClass
{
public long sum(double a,double b)
{
return Math.round(a+b);
}
}
In...
Read More