GAT Subject :: All Aptitude Test ::

Hassan
1.Default constructor has ____ arguments:
A. No argument
B. One Argument
C. Two Argument
D. No argument

2.A class whos objects can not be created is known as :
A. Absurd Class
B. Dead Class
C. Super Class
D. Absurd Class

3.Which class allows only one object to be created:
A. Nuclear Family Class
B. Abstruct Class
C. Sigleton Class
D. Nuclear Family Class

4.Reusability of code in C++ is achieved through:
A. Polymorphism
B. Inheritance
C. Encapsulation
D. Polymorphism

5.In CPP, members of a class are ______ by default.
A. Public
B. Protected
C. Static
D. Public

6.In C++ Program, inline functions are expanded during
A. Run Time
B. Compile Time
C. Debug Time
D. Run Time

7.To perfor file input / output operation in C++, we must include which header file ?
A. <fiostream>
B. <ifstream>
C. <fstream>
D. <fiostream>

8.To perfor file input / output operation in C++, we must include which header file ?
A. fiostream
B. ifstream
C. ofstream
D. fiostream

9.An exceptio in C++ can be generated using which keywords.
A. thrown
B. threw
C. throw
D. thrown

10. Which among the following is true?
A. The private members can’t be accessed by public members of the class
B. The private members can be accessed by public members of the class
C. The private members can be accessed only by the private members of the class
D. The private members can’t be accessed by public members of the class

11.Which member can never be accessed by inherited classes?
A. Private member function
B. Public member function
C. Protected member function
D. Private member function

12.Which syntax among the following shows that a member is private in a class?
A. private: functionName(parameters)
B. private(functionName(parameters))
C. private functionName(parameters)
D. private: functionName(parameters)

13. Which function among the following can’t be accessed outside the class in java in same package?
A. public void show()
B. void show()
C. protected show()
D. public void show()

14. Which function among the following can’t be accessed outside the class in java in same package?
A. public void show()
B. void show()
C. protected show()
D. public void show()

15.Which error will be produced if private members are accessed?
A. Can’t access private message
B. Code unreachable
C. Core dumped
D. Can’t access private message

16.Choose the correct remarks:
A. C++ allows any operator to be overloaded.
B. Some of the existing operators cannot be overloaded.
C. Operator precedence cannot be changed.
D. C++ allows any operator to be overloaded.

17.cout stands for:
A. class output
B. call output
C. character output
D. class output

18.The fields in a structure of a C program are by default:
A. protected
B. public
C. private
D. protected

19. Forgetting to include a file (like cmath or math.h) that is necessary will result in:
A. compilation error
B. warning when the program is run
C. error at link time
D. compilation error

20. 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

21. Which of the following specifiers need not be honored by the compiler?
A. register
B. inline
C. static
D. register

22. Which of the following cannot be declared static?
A. Functions
B. Class
C. Object
D. Functions

23.The main function of scope resolution operator (::) is ?
A. To define an object
B. To define a data member
C. To link the definition of an identifier to its declaration
D. To define an object

24. Assume a class C with objects obj1, obj2, and obj3. For the statement obj3 = obj1 – obj2 to work correctly, if the overloaded – operator must:
A. take four arguments
B. create a named temporary object
C. return a value
D. take four arguments

25.The keyword that is used that the variable can not change state?
A. const
B. private
C. friend
D. const

26.In a class, member variables are often called its _________, and its member functions are sometimes referred to as its behaviour, or ____________.
A. attributes, methods
B. attributes, activities
C. values, morals
D. attributes, methods

27.Which of these keywords are access specifiers?
A. near and far
B. table and row
C. private and public
D. near and far

28.When a class serves as base class for many derived classes, the situation is called:
A. polymorphism
B. hierarchical inheritance
C. hybrid inheritance
D. polymorphism

29.When two or more classes serve as base class for a derived class, the situation is known as
A. multiple inheritance
B. polymorphism
C. encapsulation
D. multiple inheritance

30.Multiple inheritance leaves room for a derived class to have _______ members:
A. dynamic
B. private
C. public
D. dynamic


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