Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 442 Bytes

File metadata and controls

24 lines (18 loc) · 442 Bytes

Component Accessors

For each record component, an accessor method will be available that has the name of that component.

You use these to access the values of components.

record Dog(String name) {}
~record Dog(String name) {}
class Main {
    void main() {
        var dog = new Dog("Hunter");

        // .name() accessor is available
        String name = dog.name();

        IO.println(name);
    }
}