[# 2 Java] What is object-oriented programming that you often hear?

Hello, this is Moe. This time, I've summarized the "object-oriented" that often appears when studying Java.

What is an object?

Object-oriented is a concept that was born from the fact that when trying to write a large program, the human head could not catch up and it took time to develop, or even if it was completed, it often became a program full of defects. To put it simply, it is "the idea of componentization used when developing software." If one software is made into multiple parts according to this idea, it will be easier to understand the program and it will be possible to avoid "a situation where the human head cannot catch up".
An object is simply a "thing". For example, when thinking about a car, each tire, seat, engine, etc. becomes an object.

So what is object-oriented?
In object-oriented programming, one programming is made by distinguishing the functions and roles of programming and combining them as parts (objects). Both the classes you define when coding in Java and the instances created from them are objects.
The three major object-oriented features are:


A class is a blueprint for creating an object. Describe the attributes (property) and behavior (method) of the object. Properties refer to the data that an object has, and methods refer to the functions that an object has.
Taking a car as an example, it is the blueprint from which the class makes a car. In addition, the functions such as running, turning, and stopping of the car correspond to the properties, and the specifications such as body size, body size and color, and displacement correspond to the properties.


An instance is a materialization of a class. In the case of a car, an instance is a car manufactured based on a blueprint. Also, creating an object from a class is called "instantiation".


This is a special block for performing initialization when instantiating a class.

--Do not have a return value (do not write the return type) --It has the same name as the class


A method is a collection of a series of processes. There are too many methods to remember, but you can create your own. Rather, when writing the program you want to achieve, you almost always create your own methods.

main method

This is the first method called by the system when the program is executed.

I've always wondered what object-oriented programming is, so I'm glad I could understand it a little this time. I will post again!

Recommended Posts

[# 2 Java] What is object-oriented programming that you often hear?
What is object-oriented programming? ~ Beginners ~
What is java
What is Java <>?
What is Java
What is programming?
What is Java Encapsulation?
What is Java technology?
What is Java API-java
[Java] What is flatMap?
[Java] What is JavaBeans?
[Java] What is ArrayList?
What is object-oriented after all?
What is a Java collection?
[Java] What is class inheritance?
[Java basics] What is Class?
What is java escape analysis?
What is JVM (Java Virtual Machine)?
Kantai Collection Java # 0 What is Object Oriented Programming (OOP)? [For beginners]
What is thread safe (with Java)
What is a snippet in programming?
[Java] What is Concurrent Modification Exception?
What is a lambda expression (Java)
Summary of object-oriented programming using Java
Let's think about what declarative programming is in Java and Elm (Part 1)
Review of "strange Java" and Java knowledge that is often forgotten in Java Bronze
What is a class in Java language (3 /?)
[For programming beginners] What is a method?
What is the best file reading (Java)
What is a class in Java language (1 /?)
What is Java and Development Environment (MAC)
What is a class in Java language (2 /?)
What is the main method in Java?
What to do when you want to delete a migration file that is "NO FILE"
Object-oriented programming
[Java] Object-oriented
What is the Java Servlet / JSP MVC model?
[Processing x Java] Data type and object-oriented programming
What is the volatile modifier for Java variables?
A memo for myself that object-oriented is something
Recommended site for errors that you often see
A description of Interface that is often mistaken
Error logging and exception handling that you can't often see in the Java area