annotation
Like most other languages, Kotlin supports single-line and multi-line comments
Var x: Int = 4 */Copy the code
Kotlin’s multi-line comments can be nested. Always feel this nesting strange, more do not know how to think, also do not feel what is necessary
/* hehe /* embedded */ here is a comment */Copy the code
expression
An expression is a statement that consists of operators and variables linked together. A + B is an expression that links two variables A and B together by a “+”.
Var a: Int = 888 var b: Byte = 5 println("a+b=" + (a+b)) Result: A +b=893Copy the code
block
A block is usually represented by a pair of curly braces {}, and the code inside curly braces {} is called a code block. A code block is usually a whole, and this block can contain many lines of code. For example, the if (a) {} statement, when a is true, All lines in {} are executed. Without {}, the code after if would execute only the first line.