官术网_书友最值得收藏!

For-each loop

Of course, if you're a bit familiar with Java, you may argue that the previous code could be improved by using a for-each construct instead:

final String word = "Word";

for (Character c : word.toCharArray()) {
System.out.println(c);
}

The same in Kotlin would be:

val word = "Word"

for (c in word) {
println(c)
}
主站蜘蛛池模板: 莫力| 新干县| 海南省| 聊城市| 宜良县| 罗平县| 丹巴县| 洪湖市| 六盘水市| 迭部县| 乌苏市| 图木舒克市| 绥中县| 宜宾县| 陈巴尔虎旗| 绍兴市| 乐东| 昌邑市| 新竹县| 托克托县| 淳化县| 蚌埠市| 二手房| 宜兴市| 文山县| 兴国县| 邻水| 霸州市| 西林县| 长武县| 屏边| 冀州市| 民和| 巴里| 金湖县| 夏津县| 邵武市| 绥化市| 江阴市| 柞水县| 澜沧|