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 16 of 20

Q151.
What will be the output for the given set of code?
namespace ConsoleApplication4
 {
     class A
     {
         public int i;
         public void display()
         {
             Console.WriteLine(i);
         }
     }    
     class B: A 
     {
         public int j;
         public void display() 
         {
             Console.WriteLine(j);
         }
     }    
     class Program
     {
         static void Main(string[] args)
         {
             B obj = new B();
             obj.j = 1;
             obj.i = 8;
             obj.display();
             Console.ReadLine();
         }
     }
 }
Discuss
Answer: (c).1
Discuss
Answer: (d).None of the mentioned
Q153.
Which of the following cannot be used to declare an interface correctly?
Discuss
Answer: (c).Structures
Q154.
A class consists of two interfaces with each interface consisting of three methods.The class had no instance data. Which of the following indicates the correct size of object created from this class?
Discuss
Answer: (d).24 bytes
Discuss
Answer: (a).The calls to implementation of interface methods are routed through a method table
Discuss
Answer: (b).Properties could be declared inside an interface
Q157.
Which keyword is used for correct implementation of an interface in C#.NET?
Discuss
Answer: (a).interface
Discuss
Answer: (d).All of the mentioned
Q159.
Which of the following is the correct way of implementing an interface addition by class maths?
Discuss
Answer: (a).class maths : addition {}
Q160.
Does C#.NET support partial implementation of interfaces?
Discuss
Answer: (b).False

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!