A good answer might be:The constructor must be named Car, the same as the name of the class. | |
Constructor Parameter ListThe constructor is used when an object is constructed. Most of the work in making an object (out of main memory) happens behind the scenes. Usually the constructors that you write initialize a few variables. The constructor for Car will initialize the three variables of the object. Here is the program, with the constructor partially finished:
The parameter list of a constructor looks like this: Each dataType is the type of one item of data that will be handed to the constructor, and each parameterName is a name that is used for that item of data.dataType parameterName , dataType parameterName , and so on | |
QUESTION 8:Fill in the blanks in the parameter list. The data type of each parameter should match the data type of an instance variable. The names of the parameters are up to you. Click Here after you have answered the question |