[JAVA] TDD study # 4 (July 16th, 2020)

New knowledge

toString method

public String toString()
//Returns a string representation of the object

Expression Creates and calls a "new" Expression method using the specified value of the specified object.

interface

Only constants and methods can be defined.

interface AAA {
    int A1 = 1;
    int A2 = 2;

    void BBB();
}

Use ʻimplements` to implement an interface in a class.

class abc implements AAA{
}

instanceof operator

Dynamically determine the type of an object. An object ・ Is it an instance of a certain class? -Is it an instance of a child class of a certain class? Is it an instance that implements a specific interface?

Recommended Posts

TDD study # 2 (July 13th, 2020)
TDD study # 5 (July 18th, 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