![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Kotlin
ChillTree
这个作者很懒,什么都没留下…
展开
-
Kotlin学习笔记一(基本语法)
Kotlin定义函数定义函数一 :fun 方法名(参数):返回值类型{ 函数体 } fun sum(a: Int, b: Int): Int { return a + b }如果返回值为空(无返回值) 则类型可以写成Unit或省略.定义函数二:fun 方法名(参数) = 表达式fun sum(a: Int, b: Int) = a + b如果函数体只是一个表达式(包括逻辑表原创 2017-08-28 22:39:59 · 375 阅读 · 0 评论 -
Kotlin学习笔记二(数据类型)
7种基本类型> Byte 1字节 > Short 2字节 > Int 4字节 > Long 8字节 > Float 4字节 > Double 8字节 > String <=2字节 位运算shl(bits) – 有符号左移 (Java 的 <<) shr(bits) – 有符号右移 (Java 的 >>) ushr(bits) – 无符号右移 (Java 的 >>>) and(bits) –原创 2017-08-30 22:08:16 · 279 阅读 · 0 评论