// 1900..1999 包含边界// 2000..<2100 不包含边界twentiethCentury = 1900..1999reverseTen = 10..1println(twentiethCentury)println(reverseTen)println(twentiethCentury.size())println(twentiethCentury.get(0))println(twentiethCentury.getFrom()) //返回首元素println(twentiethCentury.getTo()) //返回最后一个元素println(twentiethCentury.contains(2000))println(twentiethCentury.subList(0, 5)) //从第0个开始,显示5个println(reverseTen[2]) //显示第2个元素println(reverseTen.isReverse())//当前是否为逆序
时间: 2024-11-02 23:01:30