- Hands-On Design Patterns with Kotlin
- Alexey Soshin
- 71字
- 2021-06-25 20:49:22
No semicolons
In Java, every line of code must be terminated with a semicolon:
System.out.println("Hello"); //<- This is a semicolon
System.out.println("World"); //<- I still see you, semicolon
But Kotlin is a pragmatic language. So, instead, it infers during compilation where it should put the semicolons:
println("Hello") //<- No semicolon here
println("World") //<- Not here
Most of the time, you won't need to put semicolons in your code. They're considered optional.
推薦閱讀
- 程序員面試白皮書
- Android和PHP開發最佳實踐(第2版)
- Java Web基礎與實例教程(第2版·微課版)
- Mastering SVG
- C語言程序設計實踐教程
- Backbone.js Blueprints
- SQL基礎教程(視頻教學版)
- Spring Boot進階:原理、實戰與面試題分析
- C++面向對象程序設計習題解答與上機指導(第三版)
- C/C++數據結構與算法速學速用大辭典
- Julia 1.0 Programming Complete Reference Guide
- 小程序從0到1:微信全棧工程師一本通
- QlikView Unlocked
- Ext JS 4 Plugin and Extension Development
- Drupal 8 Development:Beginner's Guide(Second Edition)