The Gateway to Computer Science Excellence
+2 votes

Which of the following, in C++, is inherited in a derived class from base class?

  1. constructor
  2. destructor
  3. data members
  4. virtual methods
in Object Oriented Programming by Veteran (105k points)
recategorized by | 736 views

3 Answers

+1 vote
ans is C only data members(if they are not private) are inherited in a derived class
by Boss (49.3k points)
0 votes
only data members can be inheritable
by Junior (853 points)
0 votes
  • Data members in C++ is inherited in a derived class from base class
  • Constructor is a member function of a class which initializes objects of a class. In C++,Constructor is automatically called when object(instance of class) create.It is special member function of the class.
  • Destructor is a member function which destructs or deletes an object.
  • Virtual methods is a method which is redefined(Over-riden) in derived class

So, option (C) is correct.

by Active (1.9k points)

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,737 questions
57,291 answers
104,890 users