Last active
May 12, 2021 10:04
-
-
Save channyeintun/7a689453d0e0b65420c7bf3f801d0757 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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