Problem on overloaded constructor


Assignment:

Write the statements to create an overloaded constructor for the class named Car. The constructors should support 0, 1, or 2 arguments. The first argument will denote the engine size and contain an Integer. The default value is 360. The second argument will denote the color and should have a type of Automobile.Color. The default value is the enumeration White. Declare constants named cintDefaultEngineSize and ccolDefaultColor to store the default values. If no arguments are supplied, then use the default value. If one argument is supplied to the constructor, then assume that the argument is defining the engine size. If two arguments are supplied to the constructor, then assume that the first argument contains the engine size and the second contains the color. For each of the constructors, store the default or specified arguments in the hidden variables named mintEngineSize and mcolDefaultColor.

Your answer must be typed, double-spaced, Times New Roman font (size 12), one-inch margins on all sides, APA format.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Problem on overloaded constructor
Reference No:- TGS01927132

Now Priced at $20 (50% Discount)

Recommended (90%)

Rated (4.3/5)