LoginSignup
1
1

More than 3 years have passed since last update.

What is object in object-oriented programming

Last updated at Posted at 2019-06-12

A memorandum for myself. Focused on understanding at the cost of accuracy.

An object is

a package of data and programs to process the data.

In object-oriented programming (OOP), almost everything is an object. A user interacts with each object to proceed the program.
An important thing is that data and methods to deal with those data are combined in one object. So the user can complete the process related to the data within the object.
You can also make multiple objects interact each other.
Picture1.png

For example

Here is a glass of water. The water in the glass is the data. With a glass, you can turn the glass to pour, you can shake the glass, you can swirl the glass or turn over it etc. You can use these methods to manipulate the water.
If you have other objects, you can use those method with water to make some effects on other objects.
Picture1.png

For example, if there's another empty glass, you can do
method: pour
data: water
on the empty glass.
Then, the empty glass will be filled with water. This will be the output of your program.

Reference

https://www.youtube.com/watch?v=OEfSFrk_KEI
http://www.differencebetween.net/technology/difference-between-oop-and-pop/

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