[Groovy]Groovy with ‘with’

Groovy里with 关键字的使用

 


def calendar = Calendar.instance
calendar.with {
clear()
set MONTH, JULY
set DATE, 4
set YEAR, 1776
println time
}
posted @ 2012-11-23 13:11  卜海清  阅读(599)  评论(0)    收藏  举报