/*
  String s = "1,2;3,4,5;6,7,8";
  分成
  对应的数组
  d[0, 0] = 1.0; d[0, 1] = 2.0;
  d[1, 0] = 3.0; d[1, 1] = 4.0; d[1, 2] = 5.0;
  d[2, 0] = 6.0; d[2, 1] = 7.0; d[2, 2] = 8.0;
*/ String s = "1,2;3,4,5;6,7,8";
String[] spt = s.split(";");
Double[][] dou;
dou = new Double[spt.length][];

for( int i = 0; i < spt.length; i++ ) {
 String[] str = spt[i].split(",");
 dou[i] = new Double[str.length]; 
 for(int j = 0; j < str.length; j++ ) {
dou[i][j] = Double.valueOf(str[j]);
 }
}
for( int i = 0; i < spt.length; i++ ) {
for( int j = 0; j < dou[i].length; j++ ) {
System.out.print(dou[i][j] + "  ");
}
System.out.println();
}
/*
  String s = "1,2;3,4,5;6,7,8";
  分成
  对应的数组
  d[0, 0] = 1.0; d[0, 1] = 2.0;
  d[1, 0] = 3.0; d[1, 1] = 4.0; d[1, 2] = 5.0;
  d[2, 0] = 6.0; d[2, 1] = 7.0; d[2, 2] = 8.0;
*/ String s = "1,2;3,4,5;6,7,8";
String[] spt = s.split(";");
double[][] dou;
dou = new double[spt.length][];

for( int i = 0; i < spt.length; i++ ) {
 String[] str = spt[i].split(",");
 dou[i] = new double[str.length]; 
 for(int j = 0; j < str.length; j++ ) {
dou[i][j] = Double.parseDouble(str[j]);
 }
}
for( int i = 0; i < spt.length; i++ ) {
for( int j = 0; j < dou[i].length; j++ ) {
System.out.print(dou[i][j] + "  ");
}
System.out.println();
}
2段代码功能是一样的,问题是double 是基础类, Double是封装的类
为什么double也可以NEW,和Double NEW有什么不同吗?
Double new我知道先在STACK 生成一个引用 然后 数据是在堆里面生成,那么new double内存又
是如何分配的