LoginSignup
0
0

More than 1 year has passed since last update.

オブジェクト指向とは

Last updated at Posted at 2023-06-15

オブジェクトとは

現実世界の概念やモノをデータ(属性)と機能(手続き)でひとかたまりにした実体の事。
オブジェクトはクラスという概念によって定義され、クラスのデータに具体的な値を当てはめることでインスタンスとなり、値を使ってインスタンスは機能(手続き)を使用できる。

車というクラスを定義し、クラスのデータ(エンジンパワー、ブレーキの強さ、重さ)に具体的な値(500馬力、500馬力を一瞬で止める、2110kg)を入れるとインスタンスとなる。
これを「最強の車」いう名前を付けて、走る・止まる・曲がるなどの機能(手続き)を使用することができる。機能を使用する際にはデータを使う。
インスタンスはデータに入れた値によって色々な車を表現できる。

参考サイト

オブジェクト
https://www.sophia-it.com/content/%E3%82%AA%E3%83%96%E3%82%B8%E3%82%A7%E3%82%AF%E3%83%88

質問コーナー 三菱
https://www.mitsubishi-motors.com/jp/sustainability/contribution/people/kids/question/box/category06/qa13/

オブジェクト指向「継承」とは?わかりやすく解説してみた
https://www.sejuku.net/blog/9598

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