0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

個人的「質はともかく継続する」23日目です

pklを使ってみた その3

クラスを作成することもできるようです。

class parent {
    name: String
    money: Float
    flag: Boolean
    city: String
}

child: parent = new {
    name = "文字型"
    money = 160.13
    flag = false
    city = "東京"
}

image.png

継承も出来るようです。

class parent {
    city: String
    name: String
    money: Float
    flag: Boolean
}

child: parent = new {
    city = "東京"
    name = "文字型"
    money = 160.13
    flag = false
}

child2: parent = (child) {
    city = "大阪"
}

child3: parent = (child) {
    city = "福岡"
}

child2,3はcity以外はchildから継承されてますね。
image.png

まとめ

クラスがあることで、さらに使う場所がありそうな気がしてきました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?