开发者

how to do this in groovy, range from 1 and greater

I want numbers from 1 and greater I tried 1..n, but thi开发者_JS百科s doesn't work So I can't do this in Range?

thanks


1..Integer.MAX_VALUE
or 
1..Long.MAX_VALUE

What do you want n to signify ?


This works for me:

def n = 3
def range = 1..n
range.each { println it }

Output:

$ groovy range.groovy 
1
2
3

Can you provide a script that isn't behaving as you would like?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜