package foxe;
import javax.swing.JEditorPane;
import javax.swing.JFrame;
/**
* @author fooxe
*
* @see:Test.java
*
*
*/
public class Test extends JFrame {
private String arr[][] = null;
private String str[][] = { { "Aa", "Ab", "Ac" }, { "Ba", "Bb" }, { "Ca" } };
public static void main(String[] args) {
// TODO Auto-generated method stub
Test tes = new Test();
tes.inn();
}
public void inn() {
arr = new String[str.length][];
for (int i = 0; i < str.length; i++) {
arr = new String[str.length][str[i].length];
for (int j = 0; j < str[i].length; j++) {
arr[i][j]=str[i][j];
System.out.println("arr["+i+"]["+j+"]="+arr[i][j]);
}
}
}
}
输出结果:
arr[0][0]=Aa
arr[0][1]=Ab
arr[0][2]=Ac
arr[1][0]=Ba
arr[1][1]=Bb
arr[2][0]=Ca
时间: 2024-11-01 12:15:39