[JAVA] TDD study # 3 (July 15th, 2020)

New knowledge

static You can access the variable without instantiating the class that contains static. This variable is called a static variable or a class variable. Class variables can be used properly like global variables.


Access modifier static type name variable name//Declaration
name of the class.Variable name//call

Abstract class

It is used when it is not decided what kind of processing to perform. The abstract method does not write the processing content. Abstract classes cannot be instantiated.

abstract class Sample {    //Abstract class declaration
    abstract void test();    //Abstract method declaration.{}There is no.
}

An abstract class is a class that is supposed to be a parent class. The processing content is fixed by overriding the abstract method in the subclass.

super Access the variables and methods of the parent class from the child class.

super.Method name//Call the parent class method.

Recommended Posts

TDD study # 2 (July 13th, 2020)
TDD study # 4 (July 16th, 2020)
TDD study # 3 (July 15th, 2020)
TDD study # 1 environment construction & first test-driven development (July 6th, 2020)
5th
6th
6th
9th
7th
11th
9th
7th
11th
10th
10th