Skip to content

Instantly share code, notes, and snippets.

@channyeintun
Last active May 12, 2021 10:04
Show Gist options
  • Select an option

  • Save channyeintun/7a689453d0e0b65420c7bf3f801d0757 to your computer and use it in GitHub Desktop.

Select an option

Save channyeintun/7a689453d0e0b65420c7bf3f801d0757 to your computer and use it in GitHub Desktop.
package main
abstract class AB
interface INTF
open class X
data class Y:X()
sealed class Z
class A{
class B
inner class C
object D{//can implement interfaces
fun hello()=println("hello")
}
companion object E{//static behavior
fun hello()=println("hello")
}
}
fun main(){
println(A.B())
println(A().C())
println(A.D)
println(A.E)
A.D.hello()
A.hello()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment