Computer Science :: All Aptitude Test ::

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

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

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

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

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

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

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

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

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

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

11.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)

12. 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()

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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