Skip to content

Latest commit

 

History

History
21 lines (17 loc) · 435 Bytes

File metadata and controls

21 lines (17 loc) · 435 Bytes

Check for Equality

To check if the components of a record match with another, you can use the equals method.

record Elf(boolean pretentious) {}
~record Elf(boolean pretentious) {}
class Main {
    void main() {
        var elfOne = new Elf(true);
        var elfTwo = new Elf(true);
        
        IO.println(elfOne.equals(elfTwo));
    }
}

This is similar to how you check whether Strings are equal.