A Tricky Interview Question about C#

Here is a tricky interview question: Please write output of following code and explain why? class Base : IDisposable { public Base() { Console.WriteLine(” Base Constructor”); } static Base() { Console.WriteLine(” Base Static Constructor”); } public void Dispose() { Console.WriteLine(” Base Dispose”); } ~Base() { Console.WriteLine(” Base Destructor”); } } class Derived : Base, IDisposable …

Read More

Linked List Implementation in C#

Linked List is an interesting topic that it is a special kind of list we can use. Reference: https://www.codeproject.com/Articles/1104980/Linked-List-Implementation-in-Csharp What is Linked List? Linked list is a linear data structure. It’s a collection of elements. Element is called as Node. Each element has value(data) and reference of next node. The very first node is called as Head and …

Read More