25 October 2018

1. Basics

基本类型表格

2. Coercions

Groovy 可以强制转换类型(如果groovy知道如何转换的话)

注意as关键字

Set s = [1, 2, 3, 3]
char ch = 'H'
int[] a = [1, 2, 3, 4]

def s = [1, 2, 3, 3] as Set
def ch = 'H' as char
def a = [1, 2, 3, 4] as int[]

3. Overloadable

4. Loop

Groovy有两种循环: for或者while,注意,groovy没有`do-while`。