关于java的字符串转Int的问题;

2024-11-23 09:06:47
推荐回答(1个)
回答1:

String array[] = { "5555", "6666", "2222", "9999", "1111" };
int[] number = new int[array.length];
for (int i = 0; i < array.length; i++) {
int num = Integer.parseInt(array[i]);// 转换
number[i] = num;
}
System.out.println(number.length);