摘要: /** * 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 阅读(1785) 评论(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 阅读(1096) 评论(0) 推荐(0) 编辑