My Report

Object Oriented Programming Practice Test 3


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. Can two different functions have local class with same name?

2. Which data member in following code will be used whenever an object is created?

Class A
{ 
   int x; int y; int z;
   public : A()
   { 
      y=100; x=100*y; 
   }
};

3. Data members ________________ (C++)

4. Which specifier can be used to inherit protected members as protected in subclass but public as public in subclass?

5. Which access specifier is/are most secure during inheritance?

6. If a function has to be called only by using other member functions of the class, what should be the access specifier used for that function?

7. How many types of member functions are generally there in C++?

8. If a virtual member function is defined ___________

9. If a class doesn’t have public members, then________

10. If class A has add() function with protected access, and few other members in public. Then class B inherits class A privately. Will the user will not be able to call _________ from the object of class B.


 

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.