Originally Posted by wtp
Which code would I use to create an array?
You can use the regex split() and Integer valueOf() along with the scanner.
scan for input (input example: 1 2 3 4)
String numbers = input.split(" ");
convert to int using valueOf
add ints together to get sum.