System.out.print doesn't work
<p>I wanted to write a simple program that asks you to enter numbers by keyboard (being each number separated by a space or by a comma) and then sorts them from lower to higher.</p>

<p>What I had in mind was asking the user to enter the numbers by keyboard, setting the input to a String object, and then passing the String through a for loop that determines if a character is a digit or a normal character. If the caracter is a digit, it would be appended to a String array's field and look for the next digit and do the same thing until one character isn't a digit; in which case, it would look for another digit and repeat the same process but with the next String array's field. Once the program has passed through the hole String's length, each field of the String Array would be converted into an int, so it can be sorted and then printed.</p>

<p>Now the problem is that I can't print out the sorted numbers.
It askes me to type random numbers and it sorts them, but it doesn't print out the result.</p>

<p>Here is the source code:</p>

<pre><code>import java.util.Scanner;

public class StartHere {
public static void main(String[] args) {

    Scanner scanner = new Scanner(System.in);
    System.out.print("Type random numbers: ");
    String input = scanner.nextLine();
    String[] numString = new String[input.length()];
    int[] numbers = new int[numString.length];
    int a = 0;
    int i = 0;

    for (i = 0; i &lt; input.length(); i++){ // Each numString field is initialized as " ".
        numString[i] = "";
    }

    i = 0;

    while(i &lt; (input.length() - 1)){

        if (Character.isDigit(input.charAt(a))) { // If the character at input[a] is a digit
            numString[i] += Character.toString(input.charAt(a)); // The char is appended to the numString so the hole String field can be
                                                                 // converted to an integer later.
            a++; // We go to the next character.
        }
        if ((numString[i] != null) &amp;&amp; (!Character.isDigit(input.charAt(a)))) { // If the numString[i] field is occupped and the character
                                                                               // at input[a] is not a digit.
            i++; // We go to the next field.
        }
    }

    for (int b = 0; b &lt; numString.length;) { // Inside this for loop each field of the numString array
                                             // is converted to an integer.
        if (numString[b] != null) {
            numbers[b] = Integer.parseInt(numString[b]);
            b++;
        } else {
            b++;
        }
    }

    quickSort(numbers, 0, numbers.length - 1); // Sorts the numbers from smaller to higher.

    for (int c = 0; c &lt; numbers.length - 1; c++){ //
        if(c != numbers.length - 1){
            System.out.print(numbers[0] + ", ");
        }else System.out.println(numbers[c] + ".");
    }
}

public static void quickSort(int[] numbers, int left, int right) { // Defines the quickSort method.
    int pivot = numbers[left]; // We take the first element as pivot.
    int l = left; // Searches from left to right.
    int r = right; // Searches from right to left.
    int aux;

    while (l &lt; r) { // While searches are not cross.
        while (numbers[l] &lt;= pivot &amp;&amp; l &lt; r)
            l++; // Searches for an element higher than the pivot.
        while (numbers[r] &gt; pivot)
            r--; // Searches for an element smaller than the pivot.
        if (l &lt; r) { // If this have not been crossed.
            aux = numbers[l]; // Interchange.
            numbers[l] = numbers[r];
            numbers[r] = aux;
        }
    }
    numbers[left] = numbers[r];
    numbers[r] = pivot;
    if (left &lt; r - 1) {
        quickSort(numbers, left, right - 1);
    }
    if (r + 1 &lt; right) {
        quickSort(numbers, r + 1, right);
    }
} }
</code></pre>

<p>What could I do? Thanks in advance!</p>

<p>EDIT: Now I initialized each field of the <code>String[] numString</code> and this is what the console says:</p>

<pre><code>Exception in thread "main" java.lang.NumberFormatException: For input string: ""
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at StartHere.main(StartHere.java:34)
</code></pre>