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
A class template may inherit from another class template.
Choose an answer
True
False
Not Sure
Previous
Skip
Next
Question # 2
___________, which means if A declares B as its friend it does NOT mean that A can access private data of B. It only means that B can access all data of A.
Choose an answer
Friendship is one way only
Friendship is two way only
NO Friendship between classes
Any kind of friendship
Previous
Skip
Next
Question # 3
The mechanism of selecting function at run time according to the nature of calling object is called,
Choose an answer
late binding
static binding
virtual binding
None of the given options
Previous
Skip
Next
Question # 4
Suppose you create an uninitialized vector as follows:
vector
evec; After adding the statment, evec.push_back(21); what will happen?
Choose an answer
The following statement will add an element to the start (the back) of evec and will initialize it with the value 21.
The following statement will add an element to the center of evec and will reinitialize it with the value 21.
The following statement will delete an element to the end (the back) of evec and will reinitialize it with the value 21
The following statement will add an element to the end (the back) of evec and initialize it with the value 21
Previous
Skip
Next
Question # 5
The >= operator can be overloaded.
Choose an answer
True
False
Not Sure
Previous
Skip
Next
Question # 6
Constant objects cannot change their state,
Choose an answer
True
False
Not Sure
Previous
Skip
Next
Question # 7
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 # 8
Default constructor is such constructor which either has no ---------or if it has some parameters these have -------- values
Choose an answer
Parameter, temporary
Null, Parameter
Parameter, default
non of the given
Previous
Skip
Next
Question # 9
C++ compiler does not allow to dynamically allocate memory for object
Choose an answer
False
True
Not sure
Previous
Skip
Next
Question # 10
Which of these are examples of error handling techniques ?
Choose an answer
Abnormal Termination
Graceful Termination
Return the illegal
all of the given
Previous
Skip
Next
Question # 11
The specialization pattern
after the name says that this specialization is to be used for every,
Choose an answer
data type
meta type
virtual type
pointer type
Previous
Skip
Next
Back