[Solved] Java multiple inputs lead to an exception
“1 2” is not a string representing an int and therefore, it can not be parsed into an int. You need to split the such an input and then you can parse the individual elements into int values and perform the required arithmetic operation on them e.g. public class Main { public static void main(String[] … Read more