Static Inner Class in Kotlin

前端 未结 2 1038
忘了有多久
忘了有多久 2020-12-29 20:12

What alternative to an Inner static Class can I use in Kotlin Language, if it exists? If not, how can I solve this problem when I need to use a static cla

2条回答
  •  悲哀的现实
    2020-12-29 20:29

    You can also change the "class" to "object"

    class OuterA {
      object InnerB {
      ... }
    }
    

    OR

    object OuterA {
      object InnerB {
      ... }
    }
    

提交回复
热议问题