Why some methods are not compiled in Groovy?
Why method A is not compiled while methods B and C are 开发者_开发问答ok?
class A {
methodA() {
}
void methodB() {
}
static methodC() {
}
}
You need to use the "def" modifier in groovy if you are not declaring a type for the method:
class A {
def methodA() {
}
}
should work.
精彩评论