Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
Help us understand the problem. What is going on with this article?

What is object in object-oriented programming

More than 1 year has passed since last update.

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/

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away