Respuesta :
Answer:
public CarRecord(){
yearMade = 0;
vehicleIdNum = -1;
}
Explanation:
A constructor is used to initialize an object instantly. It does not have a return type and has the same name as class.
Create a constructor and set the year as 0 and vehicleIdNum as -1.
This constructor is the default constructor, initializes the default values for the variables, for this class.
A constructor is a block of code that is called and executed each time an object is created.
The constructor in Java is as follows:
public CarRecord(){
yearMade = 0;
vehicleIdNum = -1;
}
A constructor would have the same name as the class.
The class of the program is CarRecord; so the constructor name is CarRecord()
From the question, variables year and vehicles ID are to be initialized to 0 and -1 respectively.
So, the variable initialization is:
yearMade = 0;
vehicleIdNum = -1;
Hence, the complete code segment is:
public CarRecord(){
yearMade = 0; vehicleIdNum = -1;
}
Read more about constructors at:
https://brainly.com/question/14608885