[Java] [Basic] Glossary

Source

hoge.java


class Car //car
{
    private int num; //member//field(State / nature)
    private double gas; //member//field(State / nature)

    public Car() //Constructor 1
    {
        num = 0;
        gas = 0.0;
        System.out.println("I made a car.");
    }
    public Car(int n,double g) //Constructor 2//Overload
    {
        num = n;
        gas = g;
        System.out.println("number" + num + "Gasoline amount" + gas + "Created a car.");
    }
    public void show() //member//Method
    {
        System.out.println("The car number is" + num + "is.");
        System.out.println("The amount of gasoline" + gas + "is.");
    }
}

class Hoge
{
    public static void main(String[] args)
    {
        Car car1 = new Car(); //object(mono)
        car1.show();
    }
}

the term

class

What is the object to create? This time it's a car.

object

Things created from the class. An image in which a class is defined and an object is created from it.

field

A representation of the nature of the object. If it's a car, it's gasoline, colors ...

Instance variables

When tied to an object, it is called a instance variable.

Class variables

If you set it to static, you can access it without declaring the object. This is called a class variable.

Method

The process of changing or referencing the created object. Set the amount of gasoline and set the color.

Instance method

When tied to an object, it is called a instance method.

Class method

If you set it to static, you can access it without declaring the object. This is called a class method. You can refer to it with Car.show () without creating an object.

member

A generic term for fields and methods.

Access restrictions

When set to public, members can be accessed from outside the class. If set to private, it will not be possible to access members from outside the class.

constructor

When you declare a class that has the same function as the class name Constructor processing is performed. The constructor is not a member.

Overload

Declare duplicate constructor or method names. The number of arguments must be changed. Also called diversity, it seems to be one of the important functions of Java.

access

Refer to the members of the created object.

Recommended Posts

[Java] [Basic] Glossary
Java basic grammar
Java basic grammar
Java basic knowledge 1
[Java] Basic structure
Java basic grammar
Java basic grammar
Java exercises [Basic]
[Java] Data type ①-Basic type
Java basic date manipulation
Java basic naming conventions
Java learning memo (basic)
[Java] Basic method notes
Java basic data types
Basic Java OOps concepts
Java basic learning content 7 (exception)
Basic Authentication with Java 11 HttpClient
Java basic syntax + α trap
[Java] Basic statement for beginners
Java basic learning content 5 (modifier)
[Java] Thymeleaf Basic (Spring Boot)
Implement Basic authentication in Java
Java
Java
Java Basic Learning Content 8 (Java API)
[Beginner] Java basic "array" description
Java basic learning content 4 (repetition)
[Java] Basic terms in programming
[Java] Basic types and instruction notes
Java basic learning content 3 (operator / ternary operator)
Basic data types and reference types (Java)
Java basic learning content 9 (lambda expression)
Basic usage of java Optional Part 1
Reading and writing Java basic files
Basic processing flow of java Stream
Java basic data types and reference types
[Basic knowledge of Java] Scope of variables
[Java] Exception types and basic processing
Basic structure of Java source code
Studying Java ―― 3
[Java] array
Profiling with Java Visual VM ~ Basic usage ~
Java protected
[Java] Annotation
[Java] Module
Java array
Studying Java ―― 9
Java scratch scratch
Java tips, tips
Java methods
Java method
java (constructor)
Java array
[Java] ArrayDeque
java (override)
java (method)
Java Day 2018
Java string
java (array)
Java static
Java serialization