Object Oriented Programming Using C++ - Section 4 Multiple Questions and Answers.




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

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

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

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

25.Encapsulation is the way to add functions in a user defined structure.
A. True
B. False
C. May be
D. Can't say

«»



Date to Date Current Affairs 2022

PakMCQs.net

Quick Links

GAT Subject



   Computer Science    English Mcqs    Agriculture    

Engineering



   Computer Science    Civil Engineering    

Technical



   Networking    Electronics    Database    

Past Papers



   Model Papers    FPSC Papers