More Classes
5th Class
6th Class
7th Class
8th Class
9th Class
10th Class
11th Class
12th Class
NAT I
NAT II
CSS
IQ
General Knowledge
MDCAT
ECAT
GAT General
GAT Subject
Other Links
Go to Home
Online Tests
CS-304 Final Term Exams Preparation Virtual University MCQs With Answers
Question # 1
Which of the following is/are advantage[s] of generic programming?
Choose an answer
Reusability
Writability
Maintainability
All of given
Previous
Skip
Next
Question # 2
Which of the following is the best approach to implement generic algorithms with minimum number of coding lines?
Choose an answer
Templates
Overloading
Overriding
Friend function/class
Previous
Skip
Next
Question # 3
this pointer does not point to current object of any class,
Choose an answer
True
False
Not Sure
Previous
Skip
Next
Question # 4
Given the following class class Base{ int Age=33; } How you can improve above class with respect to accessing the field Age?
Choose an answer
Define the variable Age as private
Define the variable Age as protected
Define the variable Age as private and create a get method that returns it and a set method that updates it
Define the variable Age as protected and create a set method that returns it and a get method that updates it
Previous
Skip
Next
Question # 5
A template argument is preceded by the keyword ________.
Choose an answer
vector
class
template
type*
Previous
Skip
Next
Question # 6
When a variable is define as static in a class then all object of this class,
Choose an answer
Have different copies of this variable
Have same copy of this variable
Can not access this variable
None of given
Previous
Skip
Next
Question # 7
Compiler performs ________ type checking to diagnose type errors,
Choose an answer
Static
Dynamic
Bound
Unbound
Previous
Skip
Next
Question # 8
Friend class and friend function can be used as an alternate to each other
Choose an answer
True
False
Not Sure
Previous
Skip
Next
Question # 9
_______ remain in memory even when all objects of a class have been destroyed.
Choose an answer
Static variables
Instance variable
Primitive variables
None of given
Previous
Skip
Next
Question # 10
For classes with common behavior, you can save effort by placing the common behavior in a __________.
Choose an answer
Derived Class
Base class
Deprived Class
Named class
Previous
Skip
Next
Question # 11
this pointers are not accessible for static member functions.
Choose an answer
True
False
Not Sure
Previous
Skip
Next
Back