小编Ken*_*t23的帖子

实际Java中是否存在Processing和Eclipse中的拆分功能?

.split() 函数是否存在?当我输入:

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);
    }
}
Run Code Online (Sandbox Code Playgroud)

它说:

Main.java:4: error: incompatible types: String[] cannot be converted to int[]
    int[] numbers2 = (int[]) numbers.split(", ");
                                          ^
1 error
Run Code Online (Sandbox Code Playgroud)

java eclipse processing

2
推荐指数
1
解决办法
98
查看次数

标签 统计

eclipse ×1

java ×1

processing ×1