你可以套两层高级for循环
class Stringbuf{
static String[][] arr = {{"lilei","18","19"},{"hanmeimei","17","12"},};
//通过两次循环获得
public static void main(String[] args){
for(String[] str: arr){
//System.out.println(str);
for(String s: str)
System.out.println(s);}
}
}
输出:
lilei
18
19
hanmeimei
17
12 |