Say you have a console application with:
Main.java
and ClassA.java
Your main class contains the public static void main(String[] args)
method where you run your program, and it uses user input as arguments to call on methods in ClassA
.
Do you put user input verification in the main
method before sending the arguments to ClassA
methods?
OR
Do you put user input verification in the ClassA
methods which would relay a message back indicating successful input or not? Or throw a exception?
i.e. Integer.Parse(...)
throws NumberFormatException
when given an invalid input.