Answer :
Final answer:
The legal ways to call the methods start and brake of the car class are car2.start(); and car.brake();.
Explanation:
The legal ways to call the methods start and brake of the car class are:
- car2.start();
- car.brake();
The other options are not legal:
- A. car2→start(); - Invalid syntax. Use the dot operator (.) instead of the arrow operator (->).
- B. (); - Invalid syntax. Calling a method requires an object instance or class name followed by the dot operator (.)
- C. car→brake(); - Invalid syntax. Use the dot operator (.) instead of the arrow operator (->).
- D. car2.brake(); - Invalid syntax. Use the dot operator (.) instead of the arrow operator (->).