C# DotNet Interview Preparation 
Part 15
C# Dot Net Interview Preparation Part 14

C# DotNet Interview Preparation Part 15


✅ Question 85: What is the difference between abstract class and interface in C#?

Answer:

  • An abstract class can have both implementation and declarations.

  • An interface can only have method/property declarations (prior to C# 8.0).

Code Example:


✅ Question 86: What is the difference between Stack and Queue in C#?

Answer:

  • Stack: LIFO (Last In First Out)

  • Queue: FIFO (First In First Out)

Code Example:


✅ Question 87: What is a delegate in C#?

Answer: A delegate is a type-safe function pointer, used for defining callback methods.

Code Example:


✅ Question 88: What is the difference between public, private, protected, and internal access modifiers?

Answer:

Modifier Access Level public Accessible everywhere private Only within the same class protected Within the same class and subclasses internal Within the same assembly

Code Example:


✅ Question 89: What is an extension method in C#?

Answer: An extension method adds new methods to existing types without modifying them.

Code Example:


✅ Question 90: What is the difference between Dispose() and Finalize() in C#?

Answer:

  • Dispose() is used for manual resource cleanup via IDisposable.

  • Finalize() is used by the GC (Garbage Collector) before object destruction.

Code Example:


🏷️ Unique Hashtags:

  • #LearnDotNet

  • #CSharpBasics

  • #CodingWithAsharib

  • #DotNetJourney

  • #TechForBeginners

  • #ProgrammersLife

  • #CSharpWorld

  • #CodeDaily

  • #TechWithExamples

  • #DotNetCommunity


To view or add a comment, sign in

Others also viewed

Explore topics