
Month: March 2025
-
What are the four pillars of OOP?
Read More: What are the four pillars of OOP?Encapsulation: Hiding data and implementation details. Achieved through access modifiers (public, private, protected). Inheritance: Creating new classes based on existing classes. Promotes code reuse. Polymorphism: Allowing objects to take on multiple forms. Method overloading (same name, different parameters). Method overriding (derived class provides a different implementation of a base class method). Abstraction: Focusing on essential features and hiding unnecessary…
-
What is the difference between == and .Equals()?
Read More: What is the difference between == and .Equals()?==: Checks for reference equality (whether two references point to the same object) for reference types and value equality for value types. .Equals(): Virtual method. Can be overridden to provide custom equality logic. Example:
-
What is boxing and unboxing?
Read More: What is boxing and unboxing?Boxing: Converting a value type to an object (reference type). Unboxing: Converting an object back to a value type. Example:
-
What are events?
Read More: What are events?Events are a mechanism for objects to notify other objects about actions or changes. They are based on delegates and follow a publisher-subscriber pattern.
-
What are delegates?
Read More: What are delegates?Delegates are type-safe function pointers. They allow you to pass methods as arguments to other methods, enabling event handling and callback mechanisms. Type-safe function pointers. Purpose: Allow you to pass methods as arguments. Example:
-
What is garbage collection in .NET?
Read More: What is garbage collection in .NET?Automatic memory management by the CLR. Process: Benefits: Prevents memory leaks and simplifies memory management.
-
What is the difference between value types and reference types?
Read More: What is the difference between value types and reference types?Value types: Example: Reference types: Store a reference (memory address) to the data on the heap. Examples include string, class, and arrays. Assigning a reference type copies the reference, not the data itself. Example:
-
What is the Common Language Specification (CLS)?
Read More: What is the Common Language Specification (CLS)?A subset of the CTS that provides guidelines for language compilers.
-
What is the Common Type System (CTS)?
Read More: What is the Common Type System (CTS)?The CTS defines the rules for declaring and using data types in .NET.Purpose: Ensures that different .NET languages can work together seamlessly. Key Aspects: Example: Both C# and VB.NET can use the int data type because it’s defined in the CTS.
-
What is the Common Language Runtime (CLR)?
Read More: What is the Common Language Runtime (CLR)?The CLR is the heart of the .NET execution environment. Think of it as a virtual machine that manages .NET applications. Key Functions: