-->

OOP MCQ UNIT 2 THIRD PAGE



 Id 151

Question Parent:child is________

A base:derived

B derived:driven

C child:super

D subclass:superclass

Answer A

Marks 1

Unit II


Id 152

Question What is the syntax of inheritance of a class ?

A Class class _name

B Class name:access specifier

C Class name:access specifier class name

D none of these

Answer C

Marks 1

Unit II


Id 153

Question If an attribute is private then which methods have access to it?

A Only static methods in the same class

B Only the methods defined in that class

C Only the methods of the same package

D none of these

Answer B

Marks 1

Unit II


Id 154

Question Which of the following advantage cannot be achieved by using multiple inheritance?

A polymorphism

B dynamic binding

C both a&b

D none of these

Answer C

Marks 1

Unit II


Id 155

Question Which of the symbol used to create multiple inheritance ?

A Dot

B Comma

C Hash #

D Dollar

Answer B

Marks 1

Unit II


Id 156

Question Using multiple inheritance

A there can be virtual class

B it can not be include virtual class

C the base classes must have only default constructor

D none of theseAnswer A

Marks 1

Unit II


Id 157

Question The______member function is declared in base class but redefined in derived class

A class

B overloaded

C operator

D virtual

Answer D

Marks 1

Unit II


Id 158

Question In public inheritance ______

A All the members of base class are inherited and are made public

B Members of base class that are not private are inherited and retain their access type

C All the members of base class are inherited and retain their access type

D Only public members of base class are inherited and they remain public

Answer C

Marks 1

Unit II


Id 159

Question If class C is derived class of class B and class B is a derived class of A. If we instantiate 

class B object then the first constructor called belongs to class

A A

B B

C can be A or B

D one cannot achieve such inheritance

Answer A

Marks 1

Unit II


Id 160

Question When the object of derived class expire, first the _______ is invoked followed by the 

________.

A derived class constructor, base class destructor

B derived class destructor , base class destructor

C base class destructor , derived class destructor

D none of these

Answer B

Marks 1

Unit II


Id 161

Question If class A inherits from class B then B is called ________ ans A is called ________ of B.

A superclass and subclass

B subclass and superclass

C subclass and child class

D superclass and parent class

Answer A

Marks 1

Unit II


Id 162

Question What does derived class does not inherit from the base class _______.

A constructor and destructor

B operator=() members

C friends

D all of these

Answer D

Marks 1

Unit II


Id 163

Question Which constructor will initialise the base class data member ?

A Base class

B Derived class

C Derived derived class

D None of these

Answer A

Marks 1

Unit II


Id 164

Question If class A is a friend class of class B, if class B is friend class of class C then_______

A class C is friend class of

B class A is friend class of

C class A and class C do not have any friendship relation.

D none of these

Answer C

Marks 1

Unit II


Id 165

Question _________ class is tightly coupled with other class.

A friend

B virtual

C abstract

D none of theseAnswer A

Marks 1

Unit II


Id 166

Question The keyword friend is used in ___________.

A the class allowing access to another class

B the private section of a class

C the public section of a class

D all of these

Answer D

Marks 1

Unit II


Id 167

Question Class Test:public A, public B is an example of multiple inheritance.

A False

B True

C

D

Answer B

Marks 1

Unit II


Id 168

Question Which of the following interface determines how your program will be used by other 

program?

A Public

B Private

C Protected

D None of these

Answer A

Marks 1

Unit II


Id 169

Question When base class pointer points to derived class object___________

A it can access only base class members

B it can access only derived class members

C both base class &derived class members

D None of these

Answer A

Marks 1

Unit II


Id 170

Question The base class will offer_____

A more specific object than the derived class

B more generalized version of its derived class

C empty templates of its derived class

D none of these

Answer B

Marks 1

Unit II


Id 171

Question In my program I have overloaded TEST::operator+ and TEST::operator= What is the 

effect on TEST::operator+= ?

A The TEST::operator+= will be automatically overloaded .first TEST::operator+ will get 

overloaded and then TEST::operator=

B The TEST::operator+= will be automatically overloaded .first TEST::operator= will 

get overloaded and then TEST::operator+

C TEST::operator+= will made invalid

D There will be no effect because all three are independent

Answer D

Marks 1

Unit II


Id 172

Question What will happen on execution of the following code ?

Class base

{

};class derived: protected base

{

};

A It will not compile as the class body of the base class is not defined

B It will not compile as the class body of the derived class is not defined

C It will compile successfully

D The compilation of above code is dependent upon the type of data provided to it

Answer C

Marks 1

Unit II


Id 173

Question The base class will offer_____

A more specific object than the derived class

B more generalized version of its derived class

C empty templates of its derived class

D none of these

Answer B

Marks 1

Unit II


Id 174

Question The hybrid inheritance is _____

A multiple inheritance

B multilevel inheritance

C multipath inheritance

D both a &c

Answer D

Marks 1

Unit II


Id 175

Question Ho

w many types of inheritance are there

A 1

B 2

C 4

D 5

Answer D

Marks 1

Unit II


Id 176

Question Choose the correct option

A a) a constructor can not be called explicitly

B b) a destructor is not inherited

C c) constructor can not be inherited

D d) All of these

Answer D

Marks 1

Unit II


Id 177

Question Suppose class derived is derived from a class Base. Both the classes contain the

Function name display() that take no argument. What will be the statement in the class 

derived which will called the display function of base class

A Display()

B Base:display()

C Base ::display()

D Can make such a cell

Answer C

Marks 1

Unit II


Id 178

Question Suppose class derived is derived from a class Base privately. The object of class Derived is located in main() can access_______.

A public members of base

B private member of base

C protected members of base

D public members of derived

Answer D

Marks 1

Unit II


Id 179

Question Multiple inheritance causes for a derived class to have ___members.

A ambiguous

B public

C private

D protected

Answer A

Marks 1

Unit II


Id 180

Question What will be the first line of specifier for the class tier, wheel &rubber. Make use of 

public rubber

A Class Tier:public wheel, public rubber

B Class wheel:public tier, public rubber

C Class rubber:public tier, public wheel

D none of these

Answer A

Marks 1

Unit II


Id 181

Question Which is the correct class defination for class C ,Which inherits from A &B classes

A Class C:A,B

B Class C::A,B

C Class C:public A,public B

D Class C:: public A,Public B

Answer C

Marks 1

Unit II


Id 182

Question The ability of function or operator to act in different ways on different data type is 

called___________

A inheritance

B polymorphism

C encapsulationD none of these

Answer B

Marks 1

Unit II


Id 183

Question _____class that declares or inherits a virtual function.

A Encapsulation data

B Inherited class

C Polymorphic class

D none of these

Answer C

Marks 1

Unit II


Id 184

Question Choose the correct option.

A A base class may have more then one derived class

B Derived class may have more than one derived class

C Both a &b

D Neither a nor b

Answer C

Marks 1

Unit II


Id 185

Question reusability is provided by which feature of c++

A polymorphisms

B abstraction

C derivation

D none of the above

Answer C

Marks 1

Unit II


Id 186

Question What types of derivations are supported by c++?

A single

B multiple

C multilevel

D all of the above

Answer D

Marks 1

Unit I

 

0 Comments