Question 6 Following subquestions refer to the class definition below: public cl
ID: 3732575 • Letter: Q
Question
Question 6 Following subquestions refer to the class definition below: public class CarPerformance private double currSpeed; private double currAcceli // Constructor definition public CarPerformance ( currSpeed 0.0 currAccel0.0) // Constructor definition public CarPerformance (double speedMph, double accelFpsps) currSpeed speedMph; currAccel accelFpspsi // Other methods. The default constructor initializes the currSpeed field to the value of the parameter speedMph True . False The statement CarPerformance car1 = new CarPerformance(); creates a CarPerformance object with both fields initialized to zero. True FalseExplanation / Answer
The default constructor initializes the currSpeed field to the value of parameter speedMph
Ans)False
_______________
The statement CarPerformance car1=new CarPerformance(); creates a CarPerormance object with both fields initialized to zero
Ans) True
_______________
The Statement CarPerformance car2=new CarPerformance(0.0,60.0);
creates a CarPerformance object with the currSpeed field initialized to 60.0 and the currAcc1 field initialized to 0.0
Ans) False
_______________
The reference variable initialization CarPerformance car3=new CarPerformance(25.0); creates a CarPerformance object with the currSpeed field initialized to 25.0
Ans)False
________________Thank You
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.