MCQOPTIONS
Saved Bookmarks
This section includes 10 Mcqs, each offering curated multiple-choice questions to sharpen your Csharp knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
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. | |
| 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 statements among following are correct?$ |
| A. | We can derive a class from a base class even if source code of base class not available |
| B. | Multiple inheritance is different from multiple levels of inheritance |
| C. | It is legal to make objects of one class as members of another class |
| D. | All of the mentioned |
| Answer» B. Multiple inheritance is different from multiple levels of inheritance | |
| 4. |
Which form of inheritance is not supported directly by C# .NET? |
| A. | Multiple inheritance |
| B. | Multilevel inheritance |
| C. | Single inheritance |
| D. | Hierarchical inheritance |
| Answer» D. Hierarchical inheritance | |
| 5. |
Given class sample is inherited by class sample 1. Which are the correct statements about construction of object of class sample? |
| A. | While creating the object firstly the constructor of class sample will be called followed by constructor of class sample 1 |
| B. | The constructor of only sample class will be called |
| C. | While creating the object firstly constructor of class sample 1 will be called followed by constructor of class sample |
| D. | The order of calling constructors depend on whether constructors in class sample and sample 1 are private or public |
| Answer» B. The constructor of only sample class will be called | |
| 6. |
Which is the correct way to create an object of the given class abc? |
| A. | Declaring existing class as sealed |
| B. | Declaring existing class as override |
| C. | Declaring existing class as overloads |
| D. | Declaring existing class as shadows |
| Answer» D. Declaring existing class as shadows | |
| 7. |
In Inheritance concept, which of the following members of base class are accessible to derived class members? |
| A. | static |
| B. | protected |
| C. | private |
| D. | shared |
| Answer» C. private | |
| 8. |
In an inheritance chain through which of 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 (.) | |
| 9. |
Declaration of a base class |
| A. | Declaration of a subclass |
| B. | Declaration of base class & subclass and how subclass inherits the base class |
| C. | None of the mentioned |
| Answer» C. None of the mentioned | |
| 10. |
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 | |