objects

Objects

  • Basially singleton class(can have object and class with same name; often for factories)

  • Define with object instead of class and be able to use instantly(can be used within itself)

Companion Object

Often define companion object with the same name as call

  • can access private members

  • like static methods(which uses ClassName.staticmethod() notation)

Last updated