My Report

Object Oriented Programming Mock Test 6


Correct Answer: 2 points | Wrong: -1 point
Grades: A* (100% score) | A (80%-99%) | B (60%-80%) | C (40%-60%) | D (0%-40%)
advertisement
 10%

Question 1 of 10

1. If a function declared as abstract in base class doesn’t have to be defined in derived class then ______

Question 1 of 10

Question 2 of 10

2. If hierarchical inheritance requires to inherit more than one class to single class, which syntax is correct? (A, B, C are class names)

Question 2 of 10

Question 3 of 10

3. If there are 3 classes. Class C is derived from class B and B is derived from A, Which class destructor will be called at last if object of C is destroyed.

Question 3 of 10

Question 4 of 10

4. Which class uses hierarchical inheritance in following code?

class A
{
	int a;
};
class B:class A
{
	int b;
};
class C:class A,class B
{
	int c;
};
class D:class A
{
	int d;
};

Question 4 of 10

Question 5 of 10

5. The virtual functions must be declared and defined in _____________ class and overridden in ___________ class.

Question 5 of 10

Question 6 of 10

6. If __________________ inheritance is done continuously, it is similar to tree structure.

Question 6 of 10

Question 7 of 10

7. Which among the following best defines the abstract methods?

Question 7 of 10

Question 8 of 10

8. Which is a must condition for virtual function to achieve runtime polymorphism?

Question 8 of 10

Question 9 of 10

9. If all the classes used parameterized constructors and no default constructor then ___________

Question 9 of 10

Question 10 of 10

10. Can abstract classes be used in multilevel inheritance?

Question 10 of 10


 

Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.