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
Assume a class C with objects obj1, obj2, and obj3. For the statement obj3 = obj1 - obj2 to work correctly, if the overloaded - operator must
Choose an answer
take two arguments
return a value
create a named temporary object.
take four arguments
Previous
Skip
Next
Question # 2
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 # 3
a’A static member function can be called, even when a class is not ____
Choose an answer
Declared
Define
Instantiated
Called
Previous
Skip
Next
Question # 4
A C++ class is similar to -----------------
Choose an answer
Structure
Header File
Library File
None of the given
Previous
Skip
Next
Question # 5
Function templates should be used where code and behavior must be identical.
Choose an answer
True
False
Not Sure
Previous
Skip
Next
Question # 6
An STL container can not be used to
Choose an answer
hold objects of class employee.
store elements in a way that makes them quickly accessible
compile c++ programs.
organize the way objects are stored in memory
Previous
Skip
Next
Question # 7
A class template may inherit from another class template.
Choose an answer
True
False
Not Sure
Previous
Skip
Next
Question # 8
A class can be identified from a statement by ------------
Choose an answer
Noun
Pronoun
Verb
Adverb
Previous
Skip
Next
Question # 9
A member function having the same name as that of a class and a ~ sign with it is called,
Choose an answer
Constructor
Getter
Setter
Destructor
Previous
Skip
Next
Question # 10
A copy constructor is invoked when
Choose an answer
a function do not returns by value
an argument is passed by value
a function returns by reference.
an argument is passed by reference.
Previous
Skip
Next
Question # 11
When a subclass specifies an alternative definition for an attribute or method of its superclass, it is _______ the definition in the superclass.
Choose an answer
overload
overriding
copy riding
none of given
Previous
Skip
Next
Back