Most asked top Interview Questions and Answers & Online Test
Education platform for interview prep, online tests, tutorials, and live practice

Build skills with focused learning paths, mock tests, and interview-ready content.

WithoutBook brings subject-wise interview questions, online practice tests, tutorials, and comparison guides into one responsive learning workspace.

Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Microsoft .NET Interview Questions and Answers

Question: Write some code using interfaces, virtual methods, and an abstract class.
Answer: using System; public interface Iexample1 { int MyMethod1(); } public interface Iexample2 { int MyMethod2(); } public abstract class ABSExample : Iexample1, Iexample2 { public ABSExample() { System.Console.WriteLine("ABSExample constructor"); } public int MyMethod1() { return 1; } public int MyMethod2() { return 2; } public abstract void MyABSMethod(); } public class VIRTExample : ABSExample { public VIRTExample() { System.Console.WriteLine("VIRTExample constructor"); } public override void MyABSMethod() { System.Console.WriteLine("Abstract method made concrete"); } public virtual void VIRTMethod1() { System.Console.WriteLine("VIRTMethod1 has NOT been overridden"); } public virtual void VIRTMethod2() { System.Console.WriteLine("VIRTMethod2 has NOT been overridden"); } } public class FinalClass : VIRTExample { public override void VIRTMethod2() { System.Console.WriteLine("VIRTMethod2 has been overridden"); } }

Save For Revision

Bookmark this item, mark it difficult, or place it in a revision set.

Open My Learning Library
Is it helpful? Yes No

Most helpful rated by users:

Copyright © 2026, WithoutBook.