CS304 Object Oriented Programming Online Solved MCQ's Quizzes File 2





Select correct line of code for
composition relationship between
“ Keyboard ” class and “ Keys ” class
class keyboard { Keys type ;};
class keys { KeyBoard type ; };
class keyboard : private keys
class keys : private KeyBoard


Method “ getInterestRate()” should
belongs to class
Account ()
SavingAccount ()
CurrentAccount ()
None of the given options
Question # 48
Can we access methods of composed
object in the same way as we can
access methods of other objects ?
Yes
No


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 .
Select correct option :
Rational _ number operator
+ ( Rational _ number & obj );
None of the given choices
Rational _ number operator
+ ( Rational _ number & obj , double &
num );
operator+ (double & obj );


In _______________ a pointer or
reference to an object is created inside
a class
Select correct option :
Aggregation
Composition
Seperation
None of the given


Sub - Object can not be initialized using
the constructor
Select correct option :
True
False


To initialize an array of objects , only
_____________ will be called
Select correct option :
Defualt Constructor
Overloaded Constructor
Default Object
None of the above


Let Suppose a class Student with
objects std 1 , std 2 , and std 3 . For the
statement std 3 = std 1 - std 2 to work
correctly , if the overloaded - operator
must
Select correct option :
take two arguments .
None of the given choices
take single argument
take three arguments
Question # 54
Copy constructor is called when :
Select correct option :
An object is created in term of pre
existence object
An object is created
An object is initialized
None of the given


Which of the following operator doesn' t
take any argument if overloaded?
Select correct option :
/
-
+
None of the given choices


Object can be declared constant with
the use of Constant keyword .
Select correct option :
True
False


Always make pointer to null , whenever
dynamic memory is deleted .
Select correct option :
True
False


__________ provide the facility to
access the data member.
Select correct option :
accesser function
private function
inline function
None of the given


_____ is creating objects of one class
inside another class.
Association
Composition
Aggregation
Inheritance


A template provides a convenient way
to make a family of
Select correct option :
variables and data members
functions and classes
classes and exceptions
programs and algorithms


A class template may inherit from
another class template .
Select correct option :
True
False


Target of a _____ function call is
determined at run time.
Select correct option :
instance
virtual
operator
none of given


A class hierarchy
Select correct option :
shows the same relationships as an
organization chart.
describes “ has a ” relationships .
describes “ is a kind of ” relationships .
shows the same relationships as a
family tree.


Sender of the message does not need
to know the exact class of receiver
in _ _____.
Select correct option :
Abstraction
Polymorphism
Inheritance
none of the given


A function call is resolved at run - time
in _ ________
Select correct option :
non - virtual member function
virtual member function
Both non - virtual member and virtual
member function .
None of given


Adding a derived class to a base class
requires fundamental changes to the
base class .
Select correct option :
True
False


User can make virtual table explicitly .
Select correct option :
True
False

Binding means that target function for
a call is selected at compile time .
Select correct option : Static Dynamic
Automatic
None of given


Target of a _____ function call is
determined at run time.
Select correct option :
instance
virtual
operator
none of given


Which line will produce error . Class
phone : private Transmit , private
Receiver { } 1 . int main() 2 . { 3 . phone
obj; 4 . Tranmit * obj1 = & obj ; 5 .
Received obj2 = & obj; 6 . }
Select correct option :
3 rd line will produce error
4 th line will produce error
3 rd and 4 th line will produce error .
5 th line will produce error


Function overriding is done in context
of ,
Select correct option :
Single class
Single derived class
Single base class
Derived and base classes


Consider the code below , class
class1 { public: void func 1 (); }; class
class2 : protected class1 { }; Function
func1 of class1 is ____ in class 2 ,
Select correct option :
public
protected
private
none of the given options


the following statements: 1 ) int iArray
[ 5 ]; 2 ) int *pArr = iArray ;
Select correct option :
These statements will compile
successfully
Error in first statement
Error in second statement
None of given options



Select correct line of code for
inheritance relationship between
“ Gender ” class and “ Male ” class.
“ Gender ” is parent class while “ Male ”
is child class.
Select correct option :
class Male: public Gender
class Gender : public Male
class Male:: public Gender
class Gender :: public Male


Question # 6 of 10 ( Start time: 01:15:52 AM ) Total M - 1
Which one is a class association
Select correct option:
  1. Simple Association
  2. Inheritance
  3. Composition
  4. Aggregation
Question # 7 of 10 ( Start time: 01:16:55 AM ) Total M - 1
Suppose there is an object of type Person, which of the following can be considered as one of its attributes
Select correct option:
  1. Name
  2. Age
  3. Work()
  4. Both Name and Age



Question # 8 of 10 ( Start time: 01:17:52 AM ) Total M - 1
Which one is not an object association?
Select correct option:
  1. Simple association
  2. Inheritance
  3. Aggregation
  4. Association
Question # 9 of 10 ( Start time: 01:18:50 AM ) Total M - 1
Using encapsulation we can achieve
Select correct option:
  1. Information hiding
  2. Least interdependencies among modules
  3. Implementation independence
  4. All of given options
Question # 10 of 10 ( Start time: 01:19:43 AM ) Total M - 1
In constant member function the type of this pointer is:
Select correct option:
  1. Constant pointer
  2. Constant pointer to object
  3. Constant pointer to class
  4. Constant pointer to constant object
Question # 1 of 10
Which of the following is the way to extract common behavior and attributes from the given classes and make a separate class of those common behaviors and attributes?
  1. Generalization
  2. Sub-typing
  3. Specialization
  4. Extension
Question # 2 of 10
The ability to derive a class from more than one class is called
  1. Single inheritance
  2. Encapsulation
  3. Multiple inheritance
  4. Polymorphism

In ______________, a pointer or
reference to an object is created inside
a class.
Select correct option :
Aggregation
Composition
Inheritance
Association


Select correct line of code for
inheritance relationship between
“ Person ” class and “ Supervisor” class .
“ Person ” is parent class while
“ Supervisor ” is child class .
Select correct option :
class Supervisor: public Person
class Person : public Supervisor
class Supervisor: : public Person
class Person : : public Supervisor


The direction specifies which object
contains the other object. In
composition direction is must.
No
Yes

If MyClass has a destructor what is the destructor named?
  1. MyClass
  2. ~MyClass
  3. My~Class
  4. MyClass~
Question # 4 of 10:
Class abc{ ----- }; Is a valid class declaration?
  1. yes
  2. no
Question # 5of 10:
Without using Deep copy constructor, A ____________ problem can occur
  1. System crash
  2. Memory Leakage
  3. Dangling pointer
  4. All of the given
Question # 6 of 10:
If only one behaviour of a derived class is incompatible with base class, then it is:
  1. Generalization
  2. Specialization
  3. Extension
  4. Inheritance
Question # 8 of 10:
Only tangible things can be chosen as an object.
  1. True
  2. False

Select correct line of code for
inheritance relationship between “ Keys ”
class and “ SpecialKeys ” class . “ Person ”
is parent class while “ SpecialKeys ” is
child class.
Select correct option :
class SpecialKeys : public Keys
class Keys: public SpecialKeys
class SpecialKeys :: public Keys
class Keys: : public SpecialKeys


Keyboard ” class is composed off
“ keys ” class. What will be the order of
execution of destructor of “ Keyboard ”
class and “ Keys” class ?
Select correct option :
First Detructor:: Keys. .
Second Destructor ::Keyboard ..
First Destructor : : Keyboard ..
Second Destructor :: Keys. .


“ A fan has wings ” . Which type of
relationship exists between fan and
wings ?
Aggregation
Association
Composition
Inheritance


What type of relationship exists
between “ Account ” class and
“ SavingAccount ” class ?
Inheritance
Composition
Aggregation
Association


Select correct line of code for
inheritance relationship between
“ Nationality ” class and “ Citizen ” class .
“ Nationality ” is parent class while
“ Citizen ” is child class .
class Citizen : public Nationality
class Nationality : public Citizen
class Citizen : : public Nationality
class Nationality :: public Citizen


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 .
Select correct option :
Rational _ number operator
+ ( Rational _ number & obj );
None of the given choices
Rational _ number operator
+ ( Rational _ number & obj , double &
num );
operator+ (double & obj );





Let Suppose a class Student with
objects std 1 , std 2 , and std 3 . For the
statement std 3 = std 1 - std 2 to work
correctly , if the overloaded - operator
must
Select correct option :
take two arguments .
None of the given
choices take single
argument
take three arguments



Copy constructor is called when :
Select correct option :
An object is created in term of pre
existence object
An object is created
An object is initialized
None of the given


Which of the following operator doesn' t
take any argument if overloaded?
Select correct option :
/
-
+
None of the given choices


Object can be declared constant with
the use of Constant keyword .
Select correct option :
True
False




__________ provide the facility to
access the data member.
Select correct option :
accesser function
private function
inline function
None of the given


Person ” class is composed off
“ Nationality ” class . What will be the
order of execution of constructor of
“ Keyboard ” class and “ Keys ” class
First Constructor :: Nationality ..
Second Constructor : : Person ..
First Constructor :: Person ..
Second Constructor : : Nationality . .


The direction specifies which object
contains the other object. In
aggregation direction is must
Yes
No

Always make pointer to null , whenever
dynamic memory is deleted .
Select correct option :
True
False

Select correct line of code for
inheritance relationship between
“ Account ” class and “ SavingAccount ”
class. “ Account ” is parent class while
“ SavingAccount ” is child clas
class SavingAccount : public Account
class Account : public SavingAccount
class SavingAccount :: public Account
class Account : : public SavingAccount


“ Keyboard ” class is composed off
“ keys ” class. What will be the order of
execution of destructor of “ Keyboard ”
class and “ Keys” class
First Detructor:: Keys. .
Second Destructor ::Keyboard ..
First Destructor : : Keyboard ..
Second Destructor :: Keys. .


Select correct line of code for
inheritance relationship between “ Keys ”
class and “ StandardKeys” class .
“ Person ” is parent class while
“ StandardKeys ” is child class .
class StandardKeys: public Keys
class Keys: public StandardKeys
class StandardKeys:: public Keys
class Keys: : public StandardKeys


Select correct line of code for
inheritance relationship between
“ Gender ” class and “ Male ” class.
“ Gender ” is parent class while “ Male ”
is child class.
class Male: public Gender
class Gender : public Male
class Male:: public Gender
class Gender :: public Male




Select correct line of code for
composition relationship between
“ Keyboard ” class and “ Keys ” class
class keyboard { Keys type ;};
class keys { KeyBoard type ; };
class keyboard : private keys
class keys : private KeyBoard


Method “ getInterestRate()” should
belongs to class
Account ()
SavingAccount ()
CurrentAccount ()
None of the given options


Can we access methods of composed
object in the same way as we can
access methods of other objects ?
Yes
No


The sub - object ’ s life is not dependant
on the life of master class in
___________ .
Composition
Aggregation
Seperation
non of the given


correct line of code for inheritance
relationship between “ Nationality ” class
and “ Foreigner ” class. “ Nationality ” is
parent class while
“ Foreigner ” is child class.
class Foreigner : public Nationality
class Nationality : public Foreigner
class Foreigner :: public Nationality


Select correct line of code for
aggregation relationship between
“ Person ” class and “ Phone” class.
class Person { Phone * p ; };
class Phone { Person * p ; };
class Person { Phone p ; };
class Phone { Person p ; };


In ______________ destructor of sub-
object is called after destructor of
master class.
smilechat : options
Aggregation
Composition
Inheritance
Association


correct line of code for inheritance
relationship between “ Gender ” class
and “ Female” class . “ Gender ” is parent
class while “ Female ” is child
class.
class Female: public Gender
class Gender : public Female
class Female: : public Gender
class Gender :: public Female


Account ” is parent class while
“ CurrentAccount ” is child class . Can I
inherit the destructor of “ account”
class?
Yes
no


Select correct line of code for
aggregation relationship between
“ Person ” class and “ Address” class .
class Person { Address * a ; };
class Address { Person * a ; };
class Person { Address a ; };
class Address { Person a ; };


In ______________ constructors of the
sub- objects are always executed
before the constructors of the master
class.
Select correct option :
Aggregation
Composition
Inheritance
Association


What will be most appropriate C + + data
type for variable “ MinimumBalance ”?
Select correct option :
int
long int
float
double

Person ” class is composed off
“ Nationality ” class . What will be the
order of execution of constructor of
“ Keyboard ” class and “ Keys ” classFirst
Constructor :: Nationality ..
Second Constructor : : Person ..
First Constructor :: Person ..
Second Constructor : : Nationality . .


The direction specifies which object
contains the other object. In
aggregation direction is must YesNo


Select correct line of code for
inheritance relationship between
“ Account ” class and “ SavingAccount ”
class. “ Account ” is parent class while
“ SavingAccount ” is child clas
class SavingAccount : public Account
class Account : public SavingAccount
class SavingAccount :: public Account
class Account : : public SavingAccount


“ Keyboard ” class is composed off
“ keys ” class. What will be the order of
execution of destructor of “ Keyboard ”
class and “ Keys” class
First Detructor:: Keys. .
Second Destructor ::Keyboard ..
First Destructor : : Keyboard ..
Second Destructor :: Keys. .


Select correct line of code for
inheritance relationship between “ Keys ”
class and “ StandardKeys” class .
“ Person ” is parent class while
“ StandardKeys ” is child class .
class StandardKeys: public Keys
class Keys: public StandardKeys
class StandardKeys:: public Keys
class Keys: : public StandardKeys


Select correct line of code for
inheritance relationship between
“ Gender ” class and “ Male ” class.
“ Gender ” is parent class while “ Male ”
is child class.
class Male: public Gender
class Gender : public Male
class Male:: public Gender
class Gender :: public Male


What will be most appropriate C + + data
type for variable “ InterestRate
Int
long int
double
float


Select correct line of code for
composition relationship between
“ Keyboard ” class and “ Keys ” class
class keyboard { Keys type ;};
class keys { KeyBoard type ; };
class keyboard : private keys
class keys : private KeyBoard


Method “ getInterestRate()” should
belongs to class
Account ()
SavingAccount ()
CurrentAccount ()
None of the given options


Can we access methods of composed
object in the same way as we can
access methods of other objects ?
Yes
No


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 .
Select correct option :
Rational _ number operator
+ ( Rational _ number & obj );
None of the given choices
Rational _ number operator
+ ( Rational _ number & obj , double &
num );
operator+ (double & obj );


What will be most appropriate C + + data
type for variable “ InterestRate
Int
long int
double
float


In _______________ a pointer or
reference to an object is created inside
a class
Select correct option :
Aggregation
Composition
Seperation
None of the given


Sub - Object can not be initialized using
the constructor
Select correct option :
True
False


To initialize an array of objects , only
_____________ will be called
Select correct option :
Defualt Constructor
Overloaded Constructor
Default Object
None of the above




Copy constructor is called when :
Select correct option :
An object is created in term of pre
existence object
An object is created
An object is initialized
None of the given


Which of the following operator doesn' t
take any argument if overloaded?
Select correct option :
/
-
+
None of the given choices


Object can be declared constant with
the use of Constant keyword .
Select correct option :
True
False


Always make pointer to null , whenever
dynamic memory is deleted .
Select correct option :
True
False


__________ provide the facility to
access the data member.
Select correct option :
accesser function
private function
inline function
None of the given



Separation of implementation from
interface provides the facility to
restrict the _ _ _ _ _ _ _ _ _ from direct
access
Data Member
Data Function
Class
None of Given


_ _ _ _ _ _ _ _ _ _ Operator will take only
one operant.
New
int


Memory is allocated to non static
members only, when :
Class is created
object is initialized

Target of a _____ function call is
determined at run time.
Select correct option :
instance
virtual
operator
none of given

A class can inherit from more then one class is called.
Simple inheritance
Multiple inheritances 
Single inheritance 
Double inheritance

template<> class Vector{ void** p; //.... void*& operator[] ((int i); }; 
This specialization can then be used as the common implimentation for all Vectors of pointers.
This spcialization can then be used as the all type implimentation for one type classes. 
This specialization can then be used double type pointers. 
This specialization should be used for Vectors of all type int types.

Target of a _____ function call is determined at run time.
Select correct option:
instance
virtual
operator

none of given

Consider the code below, class class1{ public: int i; }; class class2 : protected class1 { }; Then int member i of class1 is____ in class2,
public
protected
private
none of the given options

Consider the code below, class class1{ private: void func1(); }; class class2 : public class1 { }; Function func1 of class1 is ____ in class2,
public
protected
private
none of the given options

Let Suppose a class Student with
objects std 1 , std 2 , and std 3 . For the
statement std 3 = std 1 - std 2 to work
correctly , if the overloaded - operator
must
Select correct option :
take two arguments .
None of the given
choices take single
argument

take three arguments

Templates automatically create different versions of a function, depending on user input.
True

False


When we create objects, then space is allocated to:
Member function
Access specifier
Data member
None of given

There is only one form of copy constructor.
True
False 

 Vukwl- Virtual Education Solution

Which of the following features of OOP is used to deal with only relevant details?
Abstraction
Information hiding
Object

___________ Binding means that targets function for a call is selected at compile time.
Static
Dynamic
Automatic
None of given 

A Class hierarchy
Shows the same relationships as an organization chart
Describes “has a” relationships.
Describes “is a kind of” relationships.
Shows the same relationships as a family tree 

In C++, we declare a function virtual by preceding the function header with keyword “Inline”.
True
False

It is illegal to make objects of one class members of another class.
True
False

In Resolution order compiler search firstly____________.
Generic Template
Partial Specification
Complete Specification
Ordinary function 

Derived class can inherit from public base class as well as private and protected base classes
True
False 

Which line will produce error. Class phone: Private Transmit, private Receiver { } 1.int main () 2. { 3.phone obj; 4.Tranmit*obj1 = &obj; 5.Received obj2 = &obj; 6.}
3rd line will produce error4th line will produce error
3rd and 4th line will produce error.
5th line will produce error. 

Methodologies to the development of reusable software relate to ____________.
Structure programming
Procedural programming
Generic programming
None of the given 

A template argument is preceded by the keyword__________.
Vector
Class
Template
Type* 

Friends are used exactly the same for template and non-template classes.
True
False 

A function template must have a parameter
True
False 

Child class can call constructor of its,

Direct base class
Indirect base class
Both direct and indirect base classes
None of these.

Which statement will be true for concrete class?
It implements an virtual concept.
It can be instantiated
It cannot be instantiated
None of given

A class D can be derived from a class C, which is derived froma class B, which is derived from a class A
True
False

Adding a derived class to a base class requires fundamental changes to the base class.
True
False

A Class or class template can have member ___________ that are themselves templates.
Variable
Function
Objects
None of given


Which will be the Primary task or tasks of generic programming?
Categorize the abstractions in a domain into concepts
Implement generic algorithms based on the concepts
Build concrete models of the concepts
All of given

The default inheritance mode is,
Public inheritance
Protected Inheritance
Private Inheritance
None of these options

If there is a pointer, p, to objects of a base class, and it contains the address of an object of a derived class, and both classes contain a virtual member function, ding(), then the statement p->ding(); will cause the version of ding() in the __________class to be executed.Base
Derived
VirtualImplemented

Sender of the message does not need to know the exact class of receiver in________.
Abstraction
Polymorphism
Inheritance
none of the given

Procedures
Packages
Templates
None of given


Templates automatically create
different versions of a function ,
depending on user input .
Select correct option :
True
False


Derived class can inherit from public
base class as well as private and
protected base classes
True
False


_____ is creating objects of one class
inside another class.
Association
Composition
Aggregation
Inheritance

In ______________ destructor of sub-
object is called after destructor of
master class.
smilechat : options
Aggregation
Composition
Inheritance
Association


Select correct line of code for
inheritance relationship between “ Keys ”
class and “ StandardKeys” class . “ Keys ”
is parent class while “ StandardKeys” is
child class
class StandardKeys: public Keys
class Keys: public StandardKeys
class StandardKeys:: public Keys
class Keys: : public StandardKeys


In ______________ constructors of the
sub- objects are always executed
before the constructors of the master
class.
Select correct option :
Aggregation
Composition
Inheritance
Association


“ Keyboard ” class is composed off
“ keys ” class. What will be the order of
execution of destructor of “ Keyboard ”
class and “ Keys” class
First Detructor:: Keys. .
Second Destructor ::Keyboard ..
First Destructor : : Keyboard ..
Second Destructor :: Keys. .
Which line will produce error. Class
phone : private Transmit , private
Receiver { } 1 . int main() 2 . { 3 . phone
obj; 4 . Tranmit * obj1 = & obj ; 5 .
Received obj2 = & obj; 6 . }
Which line will produce error . Class
phone : private Transmit , private
Receiver { } 1 . int main() 2 . { 3 . phone
obj; 4 . Tranmit * obj1 = & obj ; 5 .
Received obj2 = & obj; 6 . }
Select correct option :
3 rd line will produce error
4 th line will produce error
3 rd and 4 th line will produce error .
5 th line will produce error
What type of relationship exists
between “ Account ” class and
“ SavingAccount ” class ?
Inheritance
Composition
Aggregation
Association
A template provides a convenient way to make a family of
Select correct option:
variables and data members
functions and classes
classes and exceptions
programs and algorithms

A class template may inherit from another class template.
Select correct option:
True
False

Target of a _____ function call is determined at run time.
Select correct option:
instance
virtual
operator
none of given

A class hierarchy
Select correct option:
shows the same relationships as an organization chart.
describes “has a” relationships.
describes “is a kind of” relationships.
shows the same relationships as a family tree.

Sender of the message does not need to know the exact class of receiver in______.
Select correct option:
Abstraction
Polymorphism
Inheritance
none of the given

A function call is resolved at run-time in_________
Select correct option:
non-virtual member function
virtual member function
Both non-virtual member and virtual member function.
None of given

Adding a derived class to a base class requires fundamental changes to the base class.
Select correct option:
True
False

Select correct line of code for
inheritance relationship between
“ Gender ” class and “ Male ” class.
“ Gender ” is parent class while “ Male ”
is child class.
class Male: public Gender
class Gender : public Male
class Male:: public Gender

class Gender :: public Male

A class template may inherit from
another class template .
Select correct option :
True
False

User can make virtual table explicitly.
Select correct option:
True
False

Binding means that target function for a call is selected at compile time.
Select correct option:
Static Dynamic
Automatic
None of given



Which line will produce error. Class phone: private Transmit, private Receiver { } 1. int main() 2. { 3. phone obj; 4. Tranmit* obj1 = &obj; 5. Received obj2 = &obj; 6. }
Select correct option:
3rd line will produce error
4th line will produce error
3rd and 4th line will produce error.
5th line will produce error

The Specialization pattern after the name says that this specialization is to be used for every___.data types 
meta types 
virtual types 
pointers type

 Vukwl- Virtual Education Solution

Consider the code below, class class1{ public: void func1(); }; class class2 : protected class1 { }; Function func1 of class1 is ____ in class2,
Select correct option:
public
protected
private
none of the given options

the following statements: 1) int iArray[5]; 2) int *pArr = iArray;
Select correct option:
These statements will compile successfully
Error in first statement
Error in second statement
None of given options

Methodologies to the development of reusable software relate to________.
Select correct option:
Structure programming
procedural programming
generic programming None of the given

function template must have a parameter.
Select correct option:
True
False

The default inheritance mode is,
Select correct option:
Public inheritance
Protected inheritance
Private inheritance None of these options

Two functions with same names, parameters and return type can exist in,
Select correct option:
Function overloading Function overriding
Operator overloading
None of these options

Consider the code below, class c1{ }; class c2 : public c1 { }; class c3 : public c2 { }; Then c2 is,
Select correct option:

Direct base class of c3
Direct child class of c3
Direct base class of c1
None of these

Virtual functions allow you to
Select correct option:
create an array of type pointer-to-base class that can hold pointers to derived classes.
create functions that can never be accessed.
group objects of different classes so they can all be accessed by the same function code. use the same function call to execute member functions of objects from different classes.
User can make virtual table explicitly.
Select correct option:
True
False

In order to define a class template the first line of definition must be:
Select correct option:
template <typename T>
typename <template T>
Template Class <ClassName>
Class <Template T>

Consider the following statements: 1) int iArray[5]; 2) int *pArr = iArray;
Select correct option:
These statements will compile successfully
Error in first statement
Error in second statement None of given options


In c++ dynamic binding and polymorphism will be achieved when member function will be __.
Select correct option:
private
public
virtual
inline

Function overriding is done in context
of ,
Select correct option :
Single class
Single derived class
Single base class
Derived and base classes

 Vukwl- Virtual Education Solution

In type in depended function template should be use where code and behavior must be identical.
Select correct option:
True False

Consider the code below, class class1{ protected: int i; }; class class2 : private class1 { }; Then int member i of class1 is ____ in class2,
Select correct option:

public
protected
private
none of the given options



Consider the code below, class class1{ public: void func1(); }; class class2 : public class1 { }; Function func1 of class1 is ____ in class2,
Select correct option:
public protected
private
none of the given options

It is illegal to make objects of one class members of another class.
Select correct option:
True False

An abstract class is useful when
Select correct option:
no classes should be derived from it.
there are multiple paths from one derived class to another. no objects should be instantiated from its.
you want to defer the declaration of the class.

In resolution order compiler search firstly _______.
Select correct option:
Generic Template
Partial Specialization
Complete Specialization
Ordinary function


template<> class Vector{ void** p; //.... void*& operator[] ((int i); };
Select correct option:
This specialization can then be used as the common implimentation for all Vectors of pointers.
This spcialization can then be used as the all type implimentation for one type classes.
This specialization can then be used double type pointers.
This specialization should be used for Vectors of all type int types.


In private inheritance derived class pointer can be assigned to base class pointer in,
Select correct option:
Main function
In derived class member and friend functions
In base class member and friend functions
None of the given options

Which statement will be true for concrete class?
it implements an virtual concept.
it can be instantiated it cannot be instantiated
none of given

Target of a _____ function call is determined at run time.
Select correct option:
instance
virtual operator
none of given

The Specialization pattern after the name says that this specialization is to be used for every___.
Select correct option:
data types
meta types
virtual types
pointers type

c++ dynamic binding and polymorphism will be achieved when member function will be __.
Select correct option:
private
public
virtual inline

 Vukwl- Virtual Education Solution

Consider the code below, class class1{ protected: void func1(); }; class class2 : public class1 { }; Function func1 of class1 is ____ in class2,
Select correct option:
public
protected
private
none of the given options

Consider the code below, class class1{ protected: int i; }; class class2 : protected class1 { }; Then int member i of class1 is ____ in class2,
Select correct option:
public
protected
private none of the given options

Consider the code below, class class1{ private: void func1(); }; class class2 : private class1 { }; Function func1 of class1 is ____ in class2,
Select correct option:
public
protected
private
none of the given options

Target of a _____ function call is determined at run time.
Select correct option:
instance
virtual 
operator
none of given

Consider the following statements: 1) int iArray[5]; 2) int *pArr = iArray;
Select correct option:
These statements will compile successfully
Error in first statement
Error in second statement None of given options

Consider the code below, class class1{ private: int i; }; class class2 : private class1 { }; Then int member i of class1 is ____ in class2,
Select correct option:
public
protected
private
none of the given options

If there is a pointer, p, to objects of a base class, and it contains the address of an object of a derived class, and both classes contain a virtual member function, ding(), then the statement p->ding(); will cause the version of ding() in the ___ class to be executed.
Select correct option:
base derived
virtual
implemented

A class template may inherit from another class template.
Select correct option:
True False

Derived class can inherit from public base class as well as private and protected base classes
Select correct option:
True 
False

Two functions with same names, parameters and return type can exist in,
Select correct option:
Function overloading Function overriding
Operator overloading
None of these options

Consider the code below, class class1{ private: int i; }; class class2 : public class1 { }; Then int member i of class1 is ______ in class2,

 Vukwl- Virtual Education Solution

Select correct option:
public
protected
private
none of the given options

Target of a _____ function call is determined at run time.
Select correct option:
instance
virtual operator
none of given

A class template may inherit from another class template.
Select correct option:
True False

A function call is resolved at run-time in_________
Select correct option:
non-virtual member function
virtual member function
Both non-virtual member and virtual member function. None of given
hello

Question No: 9 ( Marks: 1 ) - Please choose one
_______ is a relationship
► Inheritance
► Polymarphism
► abstraction
► encapsulation
Question No: 10 ( Marks: 1 ) - Please choose one
__________ satisfy the condition of polymorphism
► Carbon
► Diamond
► Coal
► all of the given
Question No: 11 ( Marks: 1 ) - Please choose one

A generalization-specialization relation between classes are implemented using
► data hiding
► friend classes
► encapsulation
► inheritance
Question No: 12 ( Marks: 1 ) - Please choose one

The >= operator can be overloaded.
► True
► False
Question No: 13 ( Marks: 1 ) - Please choose one

In order to free the memory occupied by the object, we use -------------
► Constructor
► Destructor
► Shallow Copy
► Deep Copy
Question No: 14 ( Marks: 1 ) - Please choose one
Which of the following is not an example of multiple inheritances?
► Mermaid
► Woman     
► None of the given
► Amphibious Vehicle
Question No: 15 ( Marks: 1 ) - Please choose one
Static variable can be initialized more than once.
► True
► False

A class hierarchy
Select correct option:
shows the same relationships as an organization chart.
describes “has a” relationships.
describes “is a kind of” relationships. shows the same relationships as a family tree.

Consider the code below, class class1{ public: int i; }; class class2 : public class1 { }; Then int member i of class1 is ____ in class2,
Select correct option:
public protected
private
none of the given options

Consider the code below, class c1{ }; class c2 : public c1 { }; class c3 : public c2 { }; Then c1 is,
Select correct option:
Direct base class of c3
Direct child class of c3
Direct base class of c2
Direct child class of c2

A class can inherit from more then one class is called.
Select correct option:
Simple inheritance
Multiple inheritances
Single inheritance
Double inheritance

template<> class Vector{ void** p; //.... void*& operator[] ((int i); };
Select correct option:

This specialization can then be used as the common implimentation for all Vectors of pointers.
This spcialization can then be used as the all type implimentation for one type classes.
This specialization can then be used double type pointers.
This specialization should be used for Vectors of all type int types.

Consider the code below, class class1{ public: int i; }; class class2 : protected class1 { }; Then int member i of class1 is ____ in class2,
Select correct option:
public
protected
private
none of the given options

Consider the code below, class class1{ private: void func1(); }; class class2 : public class1 { }; Function func1 of class1 is ____ in class2,
Select correct option:
public
protected
private
none of the given options

Templates automatically create different versions of a function, depending on user input.
Select correct option:
True
False

 Vukwl- Virtual Education Solution

_________ Binding means that target function for a call is selected at run time
Select correct option:
Automatic
DynamicStatic
Dramatic
When we create objects, then space is allocated to:
Member function
Access specifier
Data member
None of given

There is only one form of copy constructor.
True
False


Which of the following features of OOP is used to deal with only relevant details?
Abstraction
Information hiding
Object

____________ Binding means that targets function for a call is selected at compile time.
Static
Dynamic
Automatic
None of given



In C++, we declare a function virtual by preceding the function header with keyword “Inline”
True
False

It is illegal to make objects of one class members of another class.
True
False

In private inheritance derived class pointer can be assigned to base class pointer in.
Main function

In derived class member and friend functions
In base class member and friend functions
None of the given options
Which statement will be true for concrete class?it implements an virtual concept.
it can be instantiatedit cannot be instantiated
none of given
Target of a _____ function call is determined at run time.instance
virtualoperator
none of given
The Specialization pattern after the name says that this specialization is to be used for every___.data types
meta types
virtual types
pointers type
c++ dynamic binding and polymorphism will be achieved when member function will be __.private
public
virtualinline
Consider the code below, class class1{ protected: void func1(); }; class class2 : public class1 { }; Function func1 of class1 is ____ in class2,public
protected
private
none of the given options
Consider the code below, class class1{ protected: int i; }; class class2 : protected class1 { }; Then int member i of class1 is ____ in class2,public
protected
privatenone of the given options

Sender of the message does not need
to know the exact class of receiver
in _ _____.
Select correct option :
Abstraction
Polymorphism
Inheritance
none of the given


In Resolution order compiler search firstly____________.
Generic Template
Partial Specification
Complete Specification
Ordinary function



Post a Comment

Previous Post Next Post