Groovy - Access

Card Puncher Data Processing

Default - Public

In Groovy, omitting a modifier on a field doesn’t result in a package-private field like in Java: Instead, it is used to create a property, that is to say a private field, an associated getter and an associated setter.

Private

It is possible to create a package-private field by annotating it with @PackageScope:

class Person {
    @PackageScope String name
}







Share this page:
Follow us:
Task Runner