Encapsulation, polymorphism

I commented on Separate article, but I will write it as an article.

Encapsulation

** Encapsulation is not the only way to restrict access. ** ** ** Anything can be setter / getter to destroy the encapsulation. ** **

In general, "to make" means "to make". "Article" means "article". "Japaneseization" means "Japaneseization". "Encapsulation" is "encapsulation".

For example, a "communication capsule" can be used without knowing the communication protocol or header format. Reference: http://e-words.jp/w/ Encapsulation.html

Polymorphism (polymorphism)

** Subclassing is not the only polymorphism. ** **

When you press the "Play" button, the MP3 player will read the MP3 file and play the music, and the DVD player will rotate the DVD medium to play the video and sound (line and sound effects). It is polymorphism that the same command behaves differently depending on the object. It behaves differently, but it is convenient because it can be used with the same operation interface. It can be used in the same way when a new product is released. The variety of things that can be used increases. The user does not have a hard time. Burden reduction.

There is an operation interface on the front of the DVD player and a connection interface on the back. "Playback" is one of the operation interfaces. Even different devices can be handled in a unified manner by having a common interface. The benefits of polymorphism.

Purpose

Method

Implementation means

Recommended Posts

Encapsulation, polymorphism
Polymorphism
Encapsulation
Polymorphism
Polymorphism quiz
[Java] Polymorphism
About polymorphism
java (encapsulation)
About encapsulation
[Java] Encapsulation
java (polymorphism)