Constructor
Constructor — is a special method that initializes a new object.
public class Car {
String color;
int speed;
// Constructor
public Car(String color, int speed) {
this.color = color;
this.speed = speed;
}
} Have the same name as the class and no return type.
They are called automatically when an object is created.
Semantic portal