My Report

Object Oriented Programming Practice Test 5


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

1. Which is the correct syntax of inheritance?

2. Can we call methods of base class using the constructor of the derived class?

3. Can default arguments be used with the template class?

4. If 6 classes uses single level inheritance with pair classes (3 pairs), which inheritance will this be called?

5. If a class is enclosing more than one class, than it can be called as base class of those classes.

6. While inheriting a class, if no access mode is specified, then which among the following is true? (in C++)

7. How many derived class can a single base class have?

8. What is the output of following program?

template <typename T>
void test(const T&x) 
{
    static int count = 0;
    cout << "x = " << x << " count = " << count << endl;
    ++count;
    return;
}
 
void main() 
{
    test<int> (2);
    test<int>(2);
    test<double>(2.2);
}

9. Which among the following defines single level inheritance?

10. How many basic types of inheritance are provided as OOP feature?


 

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.