Classes
class MyClass {
    name: Str,
    
    def my_instance_method(self) {
        print("hi from " + self.name)
    }
    
    def my_static_method() {
        // no access to 'name' from here
        print("hi from MyClass")
    }
}
                    Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
class MyClass {
    name: Str,
    
    def my_instance_method(self) {
        print("hi from " + self.name)
    }
    
    def my_static_method() {
        // no access to 'name' from here
        print("hi from MyClass")
    }
}