3
1

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 5 years have passed since last update.

swiftを読めるようになろう!!1(classの概念編)

Last updated at Posted at 2018-08-08

classの概念.png
#継承とは?? 
15行目のclass SuperRobot : Robot のコードのことで、SuperRobotがRobotを継承しますよって宣言すること。
#継承を使うと・・・

  • 継承により打ち間違いが少なくなり、コードが短くなる!
    (共通の部分をまとめられるから、単純に見やすい)
  • ということは、新しい機能を追加する際にベースのclassを定義すれば一回一回定義する必要がなくなる!
  • ということは、メンテナンスしやすい!
  • ただ、機能が多いアプリは継承が深くなる為、逆にわかりずらくなる

記事作成時間 約15分

3
1
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
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?