GAT Subject :: All Aptitude Test ::

Hassan
1.Use of __________ protects data from inadvertent modifications
A. protect() member function
B. private access specifier
C. class protection operator, @
D. protect() member function

2.Which of the following is not type of class?
A. Abstract Class
B. Final Class
C. Start Class
D. Abstract Class

3.Class is pass by _______?
A. Value
B. Reference
C. Value or Reference, depending on program
D. Value

4.Which is known as generic class?
A. Abstract class
B. Final class
C. Template class
D. Abstract class

5.Size of a class is :
A. Sum of size of all the variables declared inside the class
B. Sum of size of all the variables along with inherited variables in the class
C. Size of largest size of variable
D. Sum of size of all the variables declared inside the class

6.What is scope of a class nested inside another class?
A. Protected scope
B. Private scope
C. Global scope
D. Protected scope

7.Which syntax for class definition is wrong?
A. class student{ student(int a){} };
B. student class{ };
C. class student{ public: student(int a){ } };
D. class student{ student(int a){} };

8.Which of the following pairs are similar?
A. Class and object
B. Class and structure
C. Structure and object
D. Class and object

9.How members of an object are accessed?
A. Using dot operator/period symbol
B. Using scope resolution operator
C. Using member names directly
D. Using dot operator/period symbol

10.Which among the following is correct?
A. class student{ }s1,s2; s1.student()=s2.student();
B. class student{ }s1; class topper{ }t1; s1=t1;
C. class student{ }s1,s2; s1=s2;
D. class student{ }s1,s2; s1.student()=s2.student();

11.Which feature may be violated if we don’t use classes in a program?
A. Inheritance can’t be implemented
B. Object must be used is violated
C. Encapsulation only is violated
D. Inheritance can’t be implemented

12.__________ underlines the feature of Polymorphism in a class.
A. Nested class
B. Enclosing class
C. Inline function
D. Nested class

13.How many basic features of OOP are required for a programming language to be purely OOP?
A. 7
B. 6
C. 5
D. 7

14.The feature by which one object can interact with another object is:
A. Data transfer
B. Data Binding
C. Message Passing
D. Data transfer

15.Which among the following, for a pure OOP language, is true?
A. The language must follow all the rules of OOP
B. The language must follow only 3 features of OOP
C. The language should follow at least 1 feature of OOP
D. The language must follow all the rules of OOP

16.OOP provides better security than POP:
A. May not be true with respect to all programming languages
B. Always true for any programming language
C. It depends on type of program
D. May not be true with respect to all programming languages

17.What do you call the languages that support classes but not polymorphism?
A. Class based language
B. Procedure Oriented language
C. Object-based language
D. Class based language

18.Which among the following is the language which supports classes but not polymorphism?
A. SmallTalk
B. C++
C. Java
D. SmallTalk

19.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. Local function

20.What is output of the following program?
A. Its base classIts derived class
B. Its base class Its derived class
C. Its derived classIts base class
D. Its base classIts derived class

21.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. Function overloading only

22.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 into a single unit

23.Encapsulation is the way to add functions in a user defined structure.
A. True
B. False
C. May be
D. True

24.Using encapsulation data security is ___________?
A. Not ensured
B. Ensured to some extent
C. Purely ensured
D. Not ensured

25.Which among the following doesn’t come under OOP concept?
A. Platform independent
B. Data binding
C. Message passing
D. Platform independent

26.Which feature in OOP is used to allocate additional function to a predefined operator in any language?
A. Operator Overloading
B. Function Overloading
C. Operator Overriding
D. Operator Overloading

27.Exception handling is feature of OOP. State True or False.?
A. May be
B. Can't say
C. False
D. May be

28.At what point of time a variable comes into existence in memory is determined by its :
A. scope
B. data type
C. storage class
D. scope

29.Overloading is otherwise called as
A. virtual polymorphism
B. transient polymorphism
C. pseudo polymorphism
D. virtual polymorphism

30. The prototypes for friend functions are most often listed in the:
A. private declaration section
B. public declaration section
C. implementation section
D. private declaration section


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