Object Oriented Programming Using C++ - Section 4 Multiple Questions and Answers.
Exercise Questions ::
Object Oriented Programming
21. In case of using abstract class or function overloading, which function is supposed to be called first?
A. Local function B. Function with highest priority in compiler C. Global function D. Function with lowest priority because it might have been halted since long time, because of low priority
View Answer
Discuss forum
Workplace
Report
Published by:Kiran Manzoor
22. What is output of the following program?
class student
{
public : int marks;
void disp ()
{
cout< < ”its base class ”
};
class topper: public student
{
public :
void disp ()
{
cout< < ”Its derived class ”;
}
}
void main () { student s; topper t;
s.disp ();
t.disp ();
}
A. Its base classIts derived class B. Its base class Its derived class C. Its derived classIts base class D. Its derived class Its base class
View Answer
Discuss forum
Workplace
Report
Published by:Kiran Manzoor
23. If 2 classes derive one base class and redefine a function of base class, also overload some operators inside class body. Among these two things of function and operator overloading, where is polymorp
A. Function overloading only B. Operator overloading only C. Both of these are using polymorphism D. Either function overloading or operator overloading because polymorphism can be applied only once in a program
View Answer
Discuss forum
Workplace
Report
Published by:Kiran Manzoor
24. Which among the following best describes encapsulation?
A. It is a way of combining various data members into a single unit B. It is a way of combining various member functions into a single unit C. It is a way of combining various data members and member functions into a single unit which can operate on any data D. It is a way of combining various data members and member functions that operate on those data members into a single unit
View Answer
Discuss forum
Workplace
Report
Published by:Kiran Manzoor
Published by:Kiran Manzoor
« »