요즘은 다 객체지향으로 가고 있다.

OO 언어의 특징

  1. ADT ( = class) : Abstract Data Types
  2. Inheritance
  3. Dynamic Binding : 광범위 하지는 않다.

12.2

소프트웨어의 생산석을 높여야한다.

나에게 맞는 기능을 구현해야된다. → Inheritance : reuse with modification

The abstract data types in object-oriented languages, following the lead of SIMULA 67, are usually called classes. As with instances of abstract data types, class instances are called objects. A class that is defined through inheritance from another class is a derived class, a subclass, or a child class. A class from which the new class is derived is its base class, superclass, or parent class. The subprograms that define the operations on objects of a class are called methods. The calls to methods are sometimes called messages.

extends 를 이용해 상속을 받는다. 그렇지만 constructor 은 상속 되지 않는다. 그렇지만 상속받은 아이가 메소드를 실행하려고하면 부모에서 호출하기 때문에 그때 부모의 constructor 이 실행된다.

derived class , sub class, child class ↔ base class, sub class, parent class

부모에게 호출을 요청하는 것을 프로토콜, 그리고 메세지라는 용어를 쓰기도한다.

상속을 받을 때 3가지 차이점이 있을 수 있다.

  1. 일단은 다 상속 받지만 그 외에 새로운 메소드를 추가할 수 있다.
  2. 기존의 메소드를 고쳐서 사용할 수 있다. : overiding
  3. parent 의 private 은 자식도 접근 할 수 없다.