摘要:
/** * Created by Jxy on 2019/1/3 15:42 * groovy对枚举的支持 */ enum CoffeeSize{ SHORT,SMALL,BIG,MUG } def orderCoffee(size){ println "coffee is $size" switch (size){ case [CoffeeSiz... 阅读全文
posted @ 2019-01-03 16:04
JXY_Super
阅读(1829)
评论(0)
推荐(0)
摘要:
/** * Created by Jxy on 2019/1/3 10:01 * 1.实现循环的方式 * 2.安全导航操作符---?. * 3.一次性赋值给多个变量 */ 0.upto(2){ print "$it" } println "输出了所选范围内的所有值,可以设置范围的上下限" 3.times { print "$it"} println "范围从0开始" 0.step... 阅读全文
posted @ 2019-01-03 16:03
JXY_Super
阅读(1139)
评论(0)
推荐(0)

浙公网安备 33010602011771号