Reputation: 363
I know I can create a call operator for a Groovy class like this:
class MyCallable {
int call(int x) {
2*x
}
}
def mc = new MyCallable()
assert mc(2) == 4
But can I create a static call method?
class MyStaticCallable {
static int call(int x) {
2*x
}
}
assert MyStaticCallable(2) == 4
Many thanks for any help!
Upvotes: 2
Views: 309