jaspal jaspal - 4 months ago 11
Groovy Question

how to call Parameter-Less method in Groovy without braces

i can call method with parameter without braces
example:-
for def method(args){}

we can call it like

method " parameter"

but what if method does not have any parameter
void method()

how to call it without braces?

Answer

You can't, you need the braces like method() as you say