How can I create a a variable length argument using only user input? I want the user to be able to enter in 2 different kinds of data by themselves. How can I do this? I have this part down and understood, but I'm unsure of how I can change it so that the user input's it from the command line. This was a sample code I found from online. I haven't modified my code yet, but this is all I know how to do.
public static void main(String [] args){
System.out.println(average(43,546,76,8));
}
public static int average(int ... numbers){
int total = 0;
for(int x: numbers);
total =+x;
return total/numbers.length;
}