From b72bd1c909dd07032c3a3bb6e74b4614f9603e6e Mon Sep 17 00:00:00 2001 From: luming Date: Wed, 30 Jun 2021 16:13:40 +0800 Subject: [PATCH] List --- src/senior/Collection/CollectionList.kt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/senior/Collection/CollectionList.kt diff --git a/src/senior/Collection/CollectionList.kt b/src/senior/Collection/CollectionList.kt new file mode 100644 index 0000000..9e52c62 --- /dev/null +++ b/src/senior/Collection/CollectionList.kt @@ -0,0 +1,18 @@ +package senior.Collection + +class CollectionList { +} + +fun main(args: Array) { + // 空集合 + var list: List = listOf() + println(list) + + // 包含一个元素0 + var zeroList: List = listOf(0) + println(zeroList) + + // 包含多个元素 + var multiList: List = listOf(1, 2, 4, 6, 7, 9) + println(multiList) +}