1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
class Foo { construct new() {} static sayName { System.print(Foo) } sayName { System.print(Foo) } static toString { "Foo!" } } Foo.sayName // expect: Foo! Foo.new().sayName // expect: Foo!