I want that the user can type four arguments, and this results that the numbers which the user typed in get summed up together. But now I have the Problem, if the user wants to give out less arguments. How do I sum up that?
public class Sum {
public static void main(String[] args) {
int q = Integer.parseInt(args[0]);
int w = Integer.parseInt(args[1]);
int e = Integer.parseInt(args[2]);
int r = Integer.parseInt(args[3]);
int summe = q + w + e + r;
System.out.println(summe);