第五天 2020/7/10

第五天的问题

1. 数组声明与c++方法不一样

dataType[] arrayRefVar 

2. For -Each循环

引进了一种新的循环类型,被称为 For-Each 循环或者加强型循环,它能在不使用下标的情况下遍历数组。

for(type element: array) {
    System.out.println(element);
}

3.多维数组动态初始化

typeName = new type[typeLength1][typeLength2];

 

posted @ 2020-07-10 22:05  韦德·沃兹  阅读(86)  评论(0)    收藏  举报