JDK1.4中int数组转换成integer数组的方法

// 将页面id字符串分割成id字符串数组 String delst = "1,2,3,"; String[] obj = (String[]) delst.split(","); // 将字符串数组转化成int数组 int[] obj2 = new int[obj.length]; for (int i = 0; i < obj.length; i++) { obj2[i] = Integer.parseInt(obj[i]); } // 将int数组转化成Integer数组 Integer[] obj3 = new Integer[obj2.length]; for (int i = 0; i < obj2.length; i++) { obj3[i] = new Integer(obj2[i]); }

你可能感兴趣的:(JAVA技术)