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 one of the following functions returns the total number of elements in a vector.
Choose an answer
length();
size();
ele();
veclen();
Previous
Skip
Next
Question # 2
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 # 3
Static variables act like a global variable in the context or scope of the class.
Choose an answer
True
False
Not Sure
Previous
Skip
Next
Question # 4
The user must define the operation of the copy constructor.
Choose an answer
True
False
Not Sure
Previous
Skip
Next
Question # 5
An overloaded operator always requires one less argument than its number of operands.
Choose an answer
True
False
Not sure
Previous
Skip
Next
Question # 6
dentify the correct way of declaring an object of user defined template class A for char type members?
Choose an answer
A< char > obj;
< char > A obj
;
Obj < char >
A;
Previous
Skip
Next
Question # 7
Identify which of the following overloaded operator function’s declaration is appropriate for the given call?Rational_number_1 + 2.325 Where Rational_number_1 is an object of user defined class Rational_number.
Choose an answer
Rational_number operator+( Rational_number & obj);
Rational_number operator+(double& obj);
Rational_number operator+(Rational_number &obj, double& num);
operator+(double& obj);
Previous
Skip
Next
Question # 8
A normal C++ operator that acts in special ways on newly defined data types is said to be
Choose an answer
glorified
encapsulated
classified
overloaded
Previous
Skip
Next
Question # 9
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 # 10
What is a class?
Choose an answer
A class is a section of computer memory containing objects.
A class is a section of the hard disk reserved for object oriented programs
A class is the part of an object that contains the variables
A class is a description of a kind of object.
Previous
Skip
Next
Question # 11
------------- members are somewhere between public and private members. They are used in inheritance
Choose an answer
protected
public
private
global
Previous
Skip
Next
Back