Does the .split() function even exist? When I type:
public class Main {
public static void main(String[] args) {
String numbers = "1, 2, 3, 4, 5";
int[] numbers2 = (int[]) numbers.split(", ");
System.out.println(numbers2);
}
}
It says:
Main.java:4: error: incompatible types: String[] cannot be converted to int[]
int[] numbers2 = (int[]) numbers.split(", ");
^
1 error