[JAVA] About "Dependency Injection" and "Inheritance" that are easy to understand when remembered together

Introduction

I'm Matsushita from Dream Hanks. This time, I will explain about "Dependency Injection" and "extends".

Summary of serialized articles

What are "Dependency Injection" and "Inheritance"?

What is Dependency Injection?

By creating other classes or interface objects in the class you want to implement Something that allows you to use methods of other classes.

What is extends

Assuming that the implemented class is a subclass (child class), inherit the superclass (parent class) (extends) To be able to use the methods of the parent class by doing

** In short, both want to be able to use the methods of other classes in the Java class they want to implement. ** ** Besides, "constructor injection", "setter / getter injection"

Recommended Posts

About "Dependency Injection" and "Inheritance" that are easy to understand when remembered together
Dependency Injection to understand step by step
[Reading memo] System design principles that are useful in the field- "Small and easy to understand"
A site that was easy to understand when I was a beginner when I started learning Spring Boot
About DI (Dependency Injection) possible implementation that we are working on in sub iOS
How to think when you suddenly understand about generics
About encapsulation and inheritance
Three problems that beginners are likely to fall into when developing iOS apps and their analysis