Which of the following can be facilitated by the Inheritance mechanism?

computer science

Description

Which of the following can be facilitated by the Inheritance mechanism?

 1. Use the existing functionality of base class.

2. Override the existing functionality of base class.

3. Implement new functionality in the derived class.

4. Implement polymorphic behavior.

5. Implement containership.

 

a. 1, 2, and 3

b. 3 and 4

c. 2, 4 and 5

d. 3 and 5

 

Assume class B is inherited from class A. Which of the following statements is correct about construction of an object of class B?

a.       While creating the object firstly the constructor of class B will be called                                                  followed by constructor of class A.

 

b.      While creating the object firstly the constructor of class A will be called                                                  followed by constructor of class B.

 

 

c.       The constructor of only class B will be called.

 

d.      The constructor of only class A will be called.

 

 

e.      The order of calling constructors depends upon whether constructors in class A and B are private or public

 

 

 

 

 

 

Which of the following statements are correct about Inheritance in C#.NET? 1. A derived class object contains all the base class data. 2. Inheritance cannot suppress the base class functionality. 3. A derived class may not be able to access all the base class data. 4. Inheritance cannot extend the base class functionality. 5. In inheritance chain construction of object happens from base towards derived.

 

a.     1, 2, 4

b.    2, 4, 5

c.     1, 3, 5

d.    2, 4

 

 

In an inheritance chain which of the following members of base class are accessible to the derived class members?

1. static

2. protected

3. private

4. shared

5. public

 

a.     1, 3

b.    2, 5

c.     3, 4

d.    4, 5

 

 


To make a class non-inheritable, we need to declare the class as ______________

 

a.     Closed

b.    Blocked

c.     Sealed

d.    Taped

e.     None of the above 


Related Questions in computer science category


Disclaimer
The ready solutions purchased from Library are already used solutions. Please do not submit them directly as it may lead to plagiarism. Once paid, the solution file download link will be sent to your provided email. Please either use them for learning purpose or re-write them in your own language. In case if you haven't get the email, do let us know via chat support.