Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. fun main(args: Array<String>) {
  2. val a = Test()
  3. val b = Next()
  4. a.hello("山田")
  5. b.hello("鈴木")
  6. }//main
  7.  
  8. open class Test(){
  9. fun hello(name : String){
  10. println("私は${name}です。HELLO!")
  11. }//hello
  12. }//Test
  13.  
  14. class Next() : Test() //クラスの継承
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement