
Kotlin
古月印象星空
热爱生活,热爱工作
展开
-
Kotlin 类型体系和基本操作符
本文整理自Chiclaim的博客:https://chiclaim.blog.youkuaiyun.com/article/details/85575213https://chiclaim.blog.youkuaiyun.com/article/details/88624808一、 原始数据类型我们知道,在 Java 中的数据类型分基本数据类型和基本数据类型对应的包装类型。如 Java 中的整型 int ...转载 2020-04-17 21:03:15 · 571 阅读 · 0 评论 -
Kotlin的when、if 和循环语句
本文整理自:https://chiclaim.blog.youkuaiyun.com/article/details/88624808一. when语句在 Java 中有 switch 语句,在 Kotlin 中使用 when 来代替 switch1) when 的基本语法when(parameter){ branch1 -> logic branch2 -> l...原创 2020-04-13 19:54:08 · 2474 阅读 · 0 评论 -
Kotlin集合简介
本文整理自:https://chiclaim.blog.youkuaiyun.com/article/details/85575213Kotlin 中的集合底层也是使用 Java 集合框架那一套。在上层又封装了一层 可变集合 和 不可变集合 接口。下面是 Kotlin 封装的可变集合和不可变集合接口:接口 是否可变 所在文件Li...原创 2020-04-13 13:53:56 · 729 阅读 · 0 评论 -
Kotlin之lambda表达式
本文整理自:https://chiclaim.blog.youkuaiyun.com/article/details/85575213一、什么是 lambda 表达式我们先从 lambda 最基本的语法开始,引用一段 Kotlin in Action 中对 lambda 的定义:总的来说,主要有 3 点:1、lambda 总是放在一个花括号里 ({})2、箭头左边是 lambda 参数 ...原创 2020-04-10 19:02:40 · 743 阅读 · 0 评论