
输出要放在循环里面,放在外面就报错了debug
打debug肯定二维数组的关系3d

如今程序在7与8行进行循环blog
------------------------------------------------------------------------------------------------------------------------------------内存
而后经历一个中间阶段字符串

而后继续get

一直到string

就结束了
二维数组内存结构

不规则二维数组
在上面中不能 int arr=new int[][3],这样会报错,这个的意思就“零行三列”
- package me.parser;
- public class TestString{
-
- public static void main(String[] args){
-
-
-
-
-
-
-
- String s="1,2;3,4,5;6,7,8";
-
- String[] sFirst=s.split(";");
-
- String[][] word=new String[sFirst.length][];
-
- int flag=0;
- for(int i=0;i<sFirst.length;i++){
-
-
-
-
-
- String[] sSecond=sFirst[i].split(",");
-
-
-
-
-
-
-
-
-
- word[i]=new String[sSecond.length];
-
-
- for(int j=0;j<sSecond.length;j++){
-
- word[i][j]=sSecond[j];
- }
-
- System.out.println("---------------这是第"+(i+1)+"次循环-------------------");
- }
-
-
- System.out.println("输出二维数组-------------------");
- for(int i=0;i<word.length;i++){
- for(int j=0;j<word[i].length;j++){
-
- System.out.print(word[i][j]+" ");
- }
- System.out.println();
- }
-
- }
- }