Cause
This error occurs if the type of the value returned by a
If the return type of the method is a class, the value that is returned must be an instance of that class or one of its subclasses. If the return type is a primitive type, the value that is returned must be assignment-compatible with that type.
For details about assignment compatibility rules for primitive types, see "
Action
Modify the return type of the method or the type of the returned value, in order to make them compatible. In some cases, it may be possible to add a type cast to the return expression to make it compatible with the method return type.