0

I have an array filled with consecutive numbers starting from 1:

    Scanner in = new Scanner(System.in);
    int numOfValues = in.nextInt();
    int[] array = new int[numOfValues];
    for (int i = 0; i < array.length; i++) {
        array[i] = i + 1;               
    }

How can I convert this array to a list? Thanks in advance!!!

Dan
  • 175
  • 1
  • 1
  • 7

0 Answers0