How to use classes in Java?

My name is @yuka_pon and I am an intern at Future Electronic Technology.

When you're learning Java, you'll see a lot of classes, right? So this time, I've summarized what I learned about the classes that appear in Java.

About class

What is a class?

What exactly is a ** class ** in the first place?

A class is a collection of processes for executing a program. In order to perform that process, you need to create an object.

The class can be created by displaying it as follows.

class class name{
Execution processing
}

About class inheritance

Classes also have ** class inheritance **. This allows other classes to handle the execution processing held by the class in the same way. The inheriting class is called ** superclass ** or ** parent class **, while the inherited class is called ** subclass ** or ** child class **.

Class inheritance is expressed as follows:

class parent class name{
Execution processing
} 

class child class name extends parent class name{
Execution processing
}

Class type

Inner class

** Inner class ** is to create a new class within a class.

In that case, it is expressed as follows.

class class name 1{
class class name 2{
Execution processing
 }
}

Wrapper class

The ** wrapper class ** is a class used to use basic data such as int type.

There are many other classes as well. For more information, click here [https://www.sejuku.net/blog/24931).

Recommended Posts

How to use classes in Java?
Multilingual Locale in Java How to use Locale
How to use Java classes, definitions, import
[Java] How to use Map
[Java] How to use Map
How to use java Optional
How to use java class
[Java] How to use Optional ②
[Java] How to use removeAll ()
[Java] How to use string.format
How to use Java Map
How to use Java variables
[Java] How to use Optional ①
How to use Lombok in Spring
How to use Java HttpClient (Get)
How to use Java HttpClient (Post)
[Java] How to use join method
[Processing × Java] How to use variables
How to use InjectorHolder in OpenAM
[Java] How to use LinkedHashMap class
[JavaFX] [Java8] How to use GridPane
How to use class methods [Java]
[Java] How to use List [ArrayList]
How to name variables in Java
[Processing × Java] How to use arrays
How to use Java lambda expressions
Notes on how to use regular expressions in Java
[Java] How to use Math class
How to use Java enum type
How to concatenate strings in java
How to use Java enums (Enum) in MyBatis Mapper XML
How to implement date calculation in Java
How to implement Kalman filter in Java
[Java] How to use the File class
How to use custom helpers in rails
[Java] How to use the hasNext function
How to use named volume in docker-compose.yml
How to use submit method (Java Silver)
[Java] How to use the HashMap class
How to do base conversion in Java
[Easy-to-understand explanation! ] How to use Java instance
[Java] How to use the toString () method
Studying how to use the constructor (java)
[Processing × Java] How to use the loop
How to use Docker in VSCode DevContainer
How to use MySQL in Rails tutorial
How to implement coding conventions in Java
How to embed Janus Graph in Java
[Easy-to-understand explanation! ] How to use Java polymorphism
[Java] [Maven3] Summary of how to use Maven3
[Processing × Java] How to use the class
How to use Java Scanner class (Note)
[Processing × Java] How to use the function
How to use environment variables in RubyOnRails
[Easy-to-understand explanation! ] How to use ArrayList [Java]
[Java] How to use the Calendar class
Understand in 5 minutes !! How to use Docker
How to use credentials.yml.enc introduced in Rails 5.2
[Java] Learn how to use Optional correctly
[Easy-to-understand explanation! ] How to use Java overload
try-catch-finally exception handling How to use java