Created
October 1, 2019 13:56
-
-
Save rail-rate/a6b2a48ece593d351688179374c9b49d to your computer and use it in GitHub Desktop.
継承2
This file contains 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
fun main(args: Array<String>) { | |
val a = Test() | |
val b = Next() | |
a.hello("山田") | |
b.hello("鈴木") | |
}//main | |
open class Test(){ | |
fun hello(name : String){ | |
println("私は${name}です。HELLO!") | |
}//hello | |
}//Test | |
class Next() : Test() //クラスの継承 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment