Kantai Collection Java # 0 What is Object Oriented Programming (OOP)? [For beginners]

Introduction

I joined a foreign-affiliated SIer this year and am working as a Java programmer. Kantai Collection is my hobby, so this article is about trying to understand object-oriented programming by involving Kantai Collection. Kantai Collection You can understand it without knowing this, but if you don't like Kantai Collection, I recommend browser back.

What is OOP

OOP is an abbreviation for Object-Oriented Programming. In other words, object-oriented programming. Procedural programming languages ​​(C, COBOL, BASIC, etc.) describe processes and methods on data, while object-oriented programming languages ​​generate ** objects ** that contain both data and methods.

Benefits of object-oriented programming

--Fast and easy to execute --Give a clear structure to the program --Keep Java code in [DRY](https://ja.wikipedia.org/wiki/Don%27t_repeat_yourself#:~:text=Don't%20repeat%20yourself%20(DRY,%E3%81%A7%E3%81%AA%E3%81%84%E3%81%93%E3%81%A8%E3%82%92%E5%BC%B7%E8%AA%BF%E3%81%99%E3%82%8B%E3%80%82) (Don't Repeat Yourself), maintainable, easy to modify and debug —— Allows you to create fully reusable applications with less code and less development time

What are classes and objects?

Classes and objects are two major aspects of object-oriented programming.

The following shows the relationship between classes and objects. image.png The destroyer class has objects called sea breeze, beach breeze, and valley breeze, and the battleship class has objects called Yamato, Kongo, and Musashi.

A class is a template for an object, and an object is the instance (entity) of the class.

When individual objects are created, they inherit all variables and methods from the class. Inheritance means inheriting. Battleship-class objects inherit the method of firing large caliber guns, and destroyers inherit methods such as anti-submarine capabilities. It's like that.

Recommended Posts

Kantai Collection Java # 0 What is Object Oriented Programming (OOP)? [For beginners]
[For programming beginners] What is a method?
[For super super beginners] What is object orientation?
Kantai Collection Java # 1 Classes and Objects [For Beginners]
What is object-oriented programming? ~ Beginners ~
What is a Java collection?
[Technical Note] What is Object Oriented?
Learn Java with "So What" [For beginners]
What is java
What is Java <>?
What is Java
What is programming?
What is the volatile modifier for Java variables?
A collection of simple questions for Java beginners
What is Java Encapsulation?
What is object orientation?
What is Java technology?
[# 2 Java] What is object-oriented programming that you often hear?
What is Java API-java
[Java] What is flatMap?
[Java] What is JavaBeans?
[Java] What is ArrayList?
What is Java Assertion? Summary.
Maybe this is object oriented
Java debug execution [for Java beginners]
[Java] Basic statement for beginners
Muscle Java Object Oriented Day 1
[Ruby] What is `!!` used for?
[Java] What is jaee j2ee?
[Java] What is class inheritance?
Java for beginners, data hiding
What is the constructor for?
[Java basics] What is Class?
What is java escape analysis?
Java application for beginners: stream
[For beginners] You will definitely understand in 10 minutes! What is JavaBeans?
[For beginners] Ruby is said to be ruby, but what about it?
The times may come? Aspect Oriented Programming, What is the AspectJ Language?
What is JVM (Java Virtual Machine)?
Muscle Java Object Oriented Day 2 ~ Inheritance ~
[For beginners] Summary of java constructor
Rock-paper-scissors game for beginners in Java
Java for beginners, expressions and operators 1
[For beginners] Run Selenium in Java
Java for beginners, expressions and operators 2
What is thread safe (with Java)
What is a snippet in programming?
[Java] What is Concurrent Modification Exception?
Recommended learning method for programming beginners
What is a lambda expression (Java)
[For Java beginners] About exception handling
Classes and instances Java for beginners
Let's think about what declarative programming is in Java and Elm (Part 1)
I wrote EX25 of AtCoder Programming Guide for beginners (APG4b) in java.