So I've been trying to do this homework all day and I still can't figure out how to write a method to read in a line of numbers and save them into an array. This is what I tried but doesn't work

```
public static int [] readData()

    throws java.io.IOException
    {

    int [] rArray = new int[15];

    InputStreamReader isr = new InputStreamReader(System.in);
    BufferedReader br = new BufferedReader(isr);

    String data = br.readLine();
    StringTokenizer str = new StringTokenizer(data);

    String d = str.nextToken();
    int num = Integer.parseInt(d);

    for(int i = 0; i < num; i++){
    rArray[i] = num;
    }

    return rArray;

}

```