adplus-dvertising

Welcome to the Interfaces,Inheritance and Polymorphism MCQs Page

Dive deep into the fascinating world of Interfaces,Inheritance and Polymorphism with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Interfaces,Inheritance and Polymorphism, a crucial aspect of C# Programming. In this section, you will encounter a diverse range of MCQs that cover various aspects of Interfaces,Inheritance and Polymorphism, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within C# Programming.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Interfaces,Inheritance and Polymorphism. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of C# Programming.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Interfaces,Inheritance and Polymorphism. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Interfaces,Inheritance and Polymorphism MCQs | Page 5 of 20

Explore more Topics under C# Programming

Q41.
Which of the following operators cannot be overloaded?

1. true
2. false
3. new
4. ~
5. sizeof
Discuss
Answer: (c).3, 5
Q42.
Which of the following modifier is used when a virtual method is redefined by a derived class?
Discuss
Answer: (b).override
Q43.
In order for an instance of a derived class to completely take over a class member from a base class, the base class has to declare that member as
Discuss
Answer: (c).virtual
Q44.
Which of the following can be declared as a virtual in a class?

1. Methods
2. Properties
3. Events
4. Fields
5. Static fields
Discuss
Answer: (a).1, 2, 3
Discuss
Answer: (c).If a derived class does not provide its own version of virtual method then the one in the base class is used.
Q46.
Which of the following are necessary for Run-time Polymorphism?

1. The overridden base method must be virtual, abstract or override.
2. Both the override method and the virtual method must have the same access level modifier.
3. An override declaration can change the accessibility of the virtual method.
4. An abstract inherited property cannot be overridden in a derived class.
5. An abstract method is implicitly a virtual method.
Discuss
Answer: (b).1, 2, 5
Q47.
The capability of an object in Csharp to take number of different forms and hence display behaviour as according is known as:
Discuss
Answer: (b).Polymorphism
Q48.
Select the output for the given set of code?
public class sample
 {
     public static int x = 100;
     public static int y = 150;
 
 }
 public class newspaper :sample
 {
     new public static int x = 1000;
     static void Main(string[] args)
     {
         console.writeline(sample.x + "  " + sample.y + "  " + x);
     }
 }
Discuss
Answer: (c).100 150 1000
Q49.
Which of the following keyword is used to change data and behavior of a base class by replacing a member of the base class with a new derived member?
Discuss
Answer: (c).new
Discuss
Answer: (d).All of the mentioned

Suggested Topics

Are you eager to expand your knowledge beyond C# Programming? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!