Question: Question 16 0 / 5 pts When there are several classes that have many common data attributes/fields, it is better to write a(n) to hold

 Question 16 0 / 5 pts When there are several classesthat have many common data attributes/fields, it is better to write a(n)to hold all the general data. O subclass. method superclass objectQuestion 6

Question 16 0 / 5 pts When there are several classes that have many common data attributes/fields, it is better to write a(n) to hold all the general data. O subclass. method superclass objectQuestion 6 5 pts Which of the following statements is false? A public data field or function in a class can be accessed by name in any other program. O You cannot have a protected constructor. O Private members can only be accessed from the inside of the class unless from a friend class or a friend function. A protected data field or a protected function in a base class can be accessed by name in its derived classes.correct Question 20 0/5p Which of the following statements is incorrect? class Fruit public: Fruit (int id) class Apple: public Fruit public: Apple () . . The program will compile if you add a no-arg constructor for Fruit. The program will compile if you replace Apple () by Apple () : Fruit (4) . The program will compile fine. O The program has a compile error. because Fruit does not have a no-arg constructor

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!