C++ Programming: From Problem Analysis to Program Design
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN: 9781337102087
Author: D. S. Malik
Publisher: Cengage Learning
Expert Solution & Answer
Book Icon
Chapter 11, Problem 7SA

Explanation of Solution

The inheritance is a public one - the public members of the base class remain public in the derived and the private members of the base class remain private unless re-declared otherwise in the derived class. Hence, the private members of the object newCylinder are the following:

  1. height – as it is the ...

Blurred answer
Students have asked these similar questions
Find the error(s) in the following class definition: public class Circle private double radius; public double setRadius(double a) { radius = a; public void getRadius() { return radius;
Public classTestMain {     public static void main(String [ ] args)     {          Car myCar1, myCar2;          Electric Car myElec1, myElec2;          myCar1 = new Car( );          myCar2 = new Car("Ford", 1200, "Green");          myElec1 = new ElectricCar( );          myElec2 = new ElectricCar(15);          } }
26. Assume the declaration of Exercise 24. A. Write the statements that derive the class dummyClass from class base as a private inheritance. (2 lines are { and }.) "A1 is { "A2 is "A3 is )) B. Determine which members of class base are private, protected, and public in class dummyClass. "B1 is dummyClass is a de
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
  • Text book image
    EBK JAVA PROGRAMMING
    Computer Science
    ISBN:9781337671385
    Author:FARRELL
    Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT