The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+2 votes
707 views

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 (103k points)
recategorized by | 707 views

3 Answers

+1 vote
ans is C only data members(if they are not private) are inherited in a derived class
by Boss (48.5k points)
0 votes
only data members can be inheritable
by Junior (823 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)
Answer:

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,309 questions
55,743 answers
192,232 comments
90,504 users