How to handle error in this case? By Exceptions or boolean or something else
- by TP
I am trying to create a Response class in Java which has a method
void setResponse(String response);
Different response subclasses will have different requirements for the response. The string that is passed to the function is received from the user.
What is the correct way of handling a wrong response?
Should the function throw an…