What does the 'static' do in this file, sample.groovy?
static class froob {
}
The groovy code compiles fine with 'static' or without it.
There is absolutely no difference. The static in this situation is ignored.
To test, I created a groovy class and piped the output of "javap -verbose StaticTest" to a file. Then put "static" before the class def and piped that to a 2nd file. I then diffed the two files. The only differences were those unique ids that are associated with the long class ID that gets generated new for every class.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With