Skip to content

Latest commit

 

History

History
48 lines (36 loc) · 476 Bytes

Class.md

File metadata and controls

48 lines (36 loc) · 476 Bytes

1. Inner Class

Inner Class Can Use Variable of Class Variable

class Base {
  inner class Data {
    fun add() {
      print("Heelo")
    }
  }
}

Usage

var data = Data()
data.add()

OR

var data = Data().add()

2. Object Class

Object Class Can't Use Variable of Class Variable

class Base {
  object Data {
    fun add() {
      print("Heelo")
    }
  }
}

Usage

data.add()

3. Companion Object