I have a method getValue like this
public Object getValue() {
return Integer.valueOf(0);
}
and a call in the main method:
getValue() + 5;
This is simplified.
How to get this working without casting in the main method, but instead how to cast the return type if possible?
You could use generics: