--:--









Quiz for Base and derived classes

Course: C++ Language | Subject: Unit 6 | Topic: Inheritance



Logo

Q1: What is a base class in C++ inheritance?

Logo

Q2: What is a derived class?

Logo

Q3: How do you declare inheritance from a base class?

Logo

Q4: What is the default access specifier for inheritance in C++ class?

Logo

Q5: Which access specifier allows derived classes to access base members?

Logo

Q6: Can a derived class access private members of the base class directly?

Logo

Q7: Which keyword is used to call a base class constructor in derived class?

Logo

Q8: If no constructor is defined in derived class, which constructor is called?

Logo

Q9: Can a derived class override a base class method?

Logo

Q10: What happens if base class destructor is not virtual?

Logo

Q11: Which of these statements is correct?

Logo

Q12: What is slicing in C++ inheritance?

Logo

Q13: How do you access a base class member that is hidden by derived class?

Logo

Q14: What access specifier allows base class members to be accessible everywhere?

Logo

Q15: Can you instantiate an object of an abstract base class?

Logo

Q16: What happens if you assign derived class pointer to base class pointer?

Logo

Q17: How to prevent inheritance from a class?

Logo

Q18: Is multiple inheritance allowed in C++?

Logo

Q19: What is the effect of virtual functions in base class?

Logo

Q20: What does "override" specifier ensure?

Are you ready to start test? Set your time limit