Which of the statements is FALSE regarding the following program? class Car { } protected double m_mpg; public Car (double mpg) (m_mpg = mpg;} "1 void printMPG () (System.out.println("Car - + m_mpg); } class Sedan extends Car [ public int m_numDoors; public Sedan (int mpg, int numDoors) { super (mpg); m numDoors = numDoors; } } void printMPG () (System.out.println("Sedan void print Doors () (System.out.println("Sedan m numDoors); } void increaseMPG () {m_mpg++; } 1. class Test Driver { 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. public static void main(String args[]) { Car cl= new Car (25); Car c2 = new Sedan (30, 4); Sedan c3 new Sedan (28, 2); cl.printMPG (); cl = c2; cl.increaseMPG (); c2.printMPG (); c3.m numDoors = 4; c3.printDoors (); c3.increaseMPG (); c2 = c3; c2.printMPG (); 11 + m mpg); } - "+
Which of the statements is FALSE regarding the following program? class Car { } protected double m_mpg; public Car (double mpg) (m_mpg = mpg;} "1 void printMPG () (System.out.println("Car - + m_mpg); } class Sedan extends Car [ public int m_numDoors; public Sedan (int mpg, int numDoors) { super (mpg); m numDoors = numDoors; } } void printMPG () (System.out.println("Sedan void print Doors () (System.out.println("Sedan m numDoors); } void increaseMPG () {m_mpg++; } 1. class Test Driver { 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. public static void main(String args[]) { Car cl= new Car (25); Car c2 = new Sedan (30, 4); Sedan c3 new Sedan (28, 2); cl.printMPG (); cl = c2; cl.increaseMPG (); c2.printMPG (); c3.m numDoors = 4; c3.printDoors (); c3.increaseMPG (); c2 = c3; c2.printMPG (); 11 + m mpg); } - "+
Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter10: Object-oriented Programming
Section: Chapter Questions
Problem 16RQ
Related questions
Question
100%
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage