kotlin: common symbols

"?" Added after the variable name, the system will not report in any case it is a null pointer exception.
"!!" followed by the variable name, if the object is null, then the system will report an exception!

var variable is a variable which is a variable can be changed to another value by redistribution. This way declare variables and methods in java declare variables like. val is a read-only variables, this embodiment corresponds to declare variables in the final java variables. When a val created must be initialized, because the future can not be changed.

In Kotlin, the address comparison indicates === == shows a comparison of two values ​​Size

Published 81 original articles · won praise 37 · views 50000 +

Guess you like

Origin blog.csdn.net/gaolh89/article/details/100798311