Extracting numbers from a string into an ArrayList
Start by separating your code into input handling, computation, and output.  Each of those could have its own method(s).

For the input, you're working too hard.  The java.util.Scanner has methods to give you ints.

Think about what the inputs and outputs of each function should be.  For example, your input handling function should take an InputStream and return a List of Integers or an array of ints.