📄 two_dimensional_array2.java
字号:
//demonstrate another array
class twoDArray
{
public static void main(String[] args)
{
int[][] twoDArray = new int[4][];
int k = 0;
twoDArray[0] = new int[1];
twoDArray[1] = new int[2];
twoDArray[2] = new int[3];
twoDArray[3] = new int[4];
for(int i = 0;i < 4;i++)
{
for(int j = 0;j < i + 1;j++)
{
twoDArray[i][j] = k;
k++;
System.out.print(twoDArray[i][j] + "\t");
}
System.out.println();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -