SyntaxFix
Write A Post
Hire A Developer
Questions
Java has a method for this, "convertStringArrayToIntArray".
String numbers = sc.nextLine(); int[] intArray = convertStringArrayToIntArray(numbers.split(", "));