- Hands-On Design Patterns with Kotlin
- Alexey Soshin
- 58字
- 2021-06-25 20:49:26
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)
}
推薦閱讀
- Bootstrap Site Blueprints Volume II
- Java應用與實戰
- ThinkPHP 5實戰
- Mastering ServiceStack
- Beginning C++ Game Programming
- Game Programming Using Qt Beginner's Guide
- Vue.js入門與商城開發實戰
- Python進階編程:編寫更高效、優雅的Python代碼
- 3D少兒游戲編程(原書第2版)
- Linux Device Drivers Development
- iOS開發實戰:從入門到上架App Store(第2版) (移動開發叢書)
- 響應式架構:消息模式Actor實現與Scala、Akka應用集成
- Python機器學習算法與應用
- Principles of Strategic Data Science
- 創意UI:Photoshop玩轉APP設計