MCQOPTIONS
Saved Bookmarks
This section includes 6 Mcqs, each offering curated multiple-choice questions to sharpen your C# Questions & Answers Fundamentals of Inheritance knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
If no access modifier for a class is specified, then class accessibility is defined as? |
| A. | public |
| B. | protected |
| C. | private |
| D. | internal |
| Answer» D. internal | |
| 2. |
If base class consist of two private integers, one static integer and derived class consist of two static integers and one private integer. What would be the size of derived class object? |
| A. | size of object depends on sizes of its non static data members |
| B. | size of a derived class object is sum of sizes of non static data members of base class and derived class |
| C. | size of object is calculated using sizeof() method |
| D. | none of the mentioned |
| Answer» B. size of a derived class object is sum of sizes of non static data members of base class and derived class | |
| 3. |
Which of the following functionality is facilitated by inheritance mechanism? |
| A. | Use the existing functionality of base class |
| B. | Override the existing functionality of base class |
| C. | Implements new functionality in derived class |
| D. | All of the mentioned |
| Answer» E. | |
| 4. |
Select the class visibility modifiers among the following: |
| A. | Private, protected, public, internal |
| B. | Private, protected, public, internal, protected internal |
| C. | Private, protected, public |
| D. | All of the mentioned |
| Answer» C. Private, protected, public | |
| 5. |
In an inheritance chain through which of the following, the base class and its components are accessible to the derived class? |
| A. | Scope resolution operator(:) |
| B. | Class visibility modifiers (public,private etc.) |
| C. | Dot operator (.) |
| D. | All of the mentioned |
| Answer» C. Dot operator (.) | |
| 6. |
Which procedure among the following should be used to implement a Has a or a Kind of relationship between two entities? |
| A. | Polymorphism |
| B. | Inheritance |
| C. | Templates |
| D. | All of the mentioned |
| Answer» C. Templates | |