Inheritance
1.

Which among the following best describes the Inheritance ?

A.  

Copying the code already written

B.  

Using the code already written once

C.  

Using already defined functions in programming language

D.  

Using the data and functions into derived segment

2.

How many basic types of inheritance are provided as OOP feature ?

A.  

4

B.  

3

C.  

2

D.  

1

3.

Which among the following best defines single level inheritance ?

A.  

A class inheriting a derived class

B.  

A class inheriting a base class

C.  

A class inheriting a nested class

D.  

A class which gets inherited by 2 classes

4.

Which among the following is correct for multiple inheritance ?

A.  

class student{public: int marks;}s; class stream{int total;}; class topper:public student, public stream{ };

B.  

class student{int marks;}; class stream{ }; class topper: public student{ };

C.  

class student{int marks;}; class stream:public student{ };

D.  

class student{ }; class stream{ }; class topper{ };

5.

Which programming language doesn’t support multiple inheritance ?

A.  

C++ and Java

B.  

C and C++

C.  

Java and SmallTalk

D.  

Java

6.

Which among the following is correct for a hierarchical inheritance ?

A.  

Two base classes can be used to be derived into one single class

B.  

Two or more classes can be derived into one class

C.  

One base class can be derived into other two derived classes or more

D.  

One base class can be derived into only 2 classes

7.

Which is the correct syntax of inheritance ?

A.  

class derived_classname : base_classname{ /*define class body*/ };

B.  

class base_classname : derived_classname{ /*define class body*/ };

C.  

class derived_classname : access base_classname{ /*define class body*/ };

D.  

class base_classname :access derived_classname{ /*define class body*/ };

8.

Which type of inheritance leads to diamond problem?

A.  

Single level

B.  

Multi-level

C.  

Multiple

D.  

Hierarchical

9.

Which access type data gets derived as private member in derived class ?

A.  

Private

B.  

Public

C.  

Protected

D.  

Protected and Private

10.

If a base class is inherited in protected access mode then which among the following is true ?

A.  

Public and Protected members of base class becomes protected members of derived class

B.  

Only protected members become protected members of derived class

C.  

Private, Protected and Public all members of base, become private of derived class

D.  

Only private members of base, become private of derived class