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
One purpose of an iterator in the STL is to connect algorithms and containers.
Choose an answer
True
False
Not Sure
Previous
Skip
Next
Question # 2
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 # 3
Consider a class named Vehicle, which of the following can be the instance of class Vehicle? 1. Car 2. Computer 3. Desk 4. Ahmed 5. Bicycle
Choose an answer
1, 4, 5
2, 5, 6
1, 2, 3, 6
1, 5, 6
Previous
Skip
Next
Question # 4
Algorithms can only be implemented using STL containers.
Choose an answer
True
False
Not Sure
Previous
Skip
Next
Question # 5
Which of the following operators always takes no argument if overloaded?
Choose an answer
/
-
+
++
Previous
Skip
Next
Question # 6
In order to define a class template, the first line of definition must be:
Choose an answer
template
typename <template T>
Template Class
Class <Template T>
Previous
Skip
Next
Question # 7
template <> class Vector
{ } This is an example of partial specialization.
Choose an answer
True
False
Not Sure
Previous
Skip
Next
Question # 8
Which of the following is an integral part of an object?
Choose an answer
State
Behavior
Unique identity
All of the given
Previous
Skip
Next
Question # 9
The ________ relationship indicates that an object contains other objects.
Choose an answer
None of given
has-a’
is-a’
be
Previous
Skip
Next
Question # 10
Static variable can be initialized more than once.
Choose an answer
True
False
Not Sure
Previous
Skip
Next
Question # 11
When we write a class template the first line must be:
Choose an answer
template < class class_name>
template < class data_type>
templete< class T >
Here T can be replaced with any name but it is preferable
class class-name() class template
Previous
Skip
Next
Back