Skip to content

Latest commit

 

History

History
9 lines (9 loc) · 473 Bytes

Any or Object ?.md

File metadata and controls

9 lines (9 loc) · 473 Bytes

Object

  • java의 최상위 클래스는 Object 클래스
  • kotlin 에서도 object 사용가능 하지만 Any는 Object의 슈퍼 클래스

Any

  • kotlin 최상위 클래스는 Any 클래스
  • any --> non-null
  • any? --> nullable
    • 모든 값을 저장할 수 있는 최상위 오브젝트로 Any?가 존재
  • Kotlin compiler treats kotlin.Any and java.lang.Object as two different types, but at runtime they are represented with the same java.lang.Object class.