/*
* 数组+常用类的习题
*
*/
public class Home1 {
public static void main(String[] args) {
String s = "1,2,3!4,5,7,8!34,45,78!3453,45";
// 1.确定二维数组内有几个一维数组
String[] split = s.split("!");// spit[0]=1,2,3
//System.out.println(Arrays.toString(split));
//确定二维数组的长度
int[][] arr1 = new int[split.length][];
// 确定二维数组内一维数组的个数
for (int i = 0; i < arr1.length; i++) {
String[] split2 = split[i].split(",");
// 确定二维数组内一维数组的长度
arr1[i] = new int[split2.length];
for (int j = 0; j < arr1[i].length; j++) {
// 将String-->int Integer.paseInt(String s);
arr1[i][j] = Integer.parseInt(split2[j]);
}
}