so basically user enters a sequence from an scanner input. 12, 3, 4, etc. It can be of any length long and it has to be integers. I want to convert the
12, 3, 4
Java has a method for this, "convertStringArrayToIntArray".
String numbers = sc.nextLine(); int[] intArray = convertStringArrayToIntArray(numbers.split(", "));