How can I make my setter method public void setYear(String year)
check if the input is a number or not? It's for a class exercise. I'm just trying to understand why/how to do this. I don't know why, but it has to be string year, and I need to make sure that only a number can be used.
For example I have:
public void setColour(String colour) {
colour = colour;
}