JDK1.5中支持的 for循环的语法

JDK1.5中支持的 for循环的语法

 

解答:

 

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

 

} type 集合(不仅仅指Collection,也包含普通的数组)中元素的数据类型 element 遍历到的元素 array 集合对象本身(当然不只是Collection)

posted @ 2018-08-29 10:18  borter  阅读(438)  评论(0编辑  收藏  举报