- 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)
}
推薦閱讀
- HTML5+CSS3王者歸來(lái)
- LabVIEW Graphical Programming Cookbook
- ASP.NET MVC4框架揭秘
- vSphere High Performance Cookbook
- Java應(yīng)用開(kāi)發(fā)與實(shí)踐
- CentOS 7 Linux Server Cookbook(Second Edition)
- Dependency Injection in .NET Core 2.0
- bbPress Complete
- Practical Microservices
- 交互式程序設(shè)計(jì)(第2版)
- 深入實(shí)踐DDD:以DSL驅(qū)動(dòng)復(fù)雜軟件開(kāi)發(fā)
- Oracle Data Guard 11gR2 Administration Beginner's Guide
- SSH框架企業(yè)級(jí)應(yīng)用實(shí)戰(zhàn)
- R語(yǔ)言:邁向大數(shù)據(jù)之路
- 樹(shù)莓派開(kāi)發(fā)從零開(kāi)始學(xué):超好玩的智能小硬件制作書(shū)