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 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 # 2
We achieve independence of internal implementation from its external interface through-----------
Choose an answer
Encapsulation
Information Hiding
Abstraction
both encapsulation and information hiding
Previous
Skip
Next
Question # 3
Which of the following causes run time binding?
Choose an answer
Declaring object of abstract class
Declaring pointer of abstract class
Declaring overridden methods as non-virtual
None of the given
Previous
Skip
Next
Question # 4
Vectors contain contiguous elements stored as a[an] ___.
Choose an answer
variable
array
function
datatype
Previous
Skip
Next
Question # 5
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 # 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
Consider the code below, class Fred { public: Fred(); ... }; int main() { Fred a[10]; Fred* p = new Fred[10]; ... } Select the best option
Choose an answer
Fred a[10]; calls the default constructor 09 times Fred* p = new Fred[10]; calls the default constructor 10 times
Produce an error
Fred a[10]; calls the default constructor 11 times Fred* p = new Fred[10]; calls the default constructor 11 times
Fred a[10]; calls the default constructor 10 times Fred* p = new Fred[10]; calls the default constructor 10 times
Previous
Skip
Next
Question # 8
Constant objects cannot change their state,
Choose an answer
True
False
Not Sure
Previous
Skip
Next
Question # 9
template <> class Vector
{ } This is an example of partial specialization.
Choose an answer
True
False
Not Sure
Previous
Skip
Next
Question # 10
Function templates should be used where code and behavior must be identical.
Choose an answer
True
False
Not Sure
Previous
Skip
Next
Question # 11
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
Back