| WPF-Question-Answers-101-110 :👈 | 👉:C# Threading QA-51-62 |
C# (C-Sharp) Question Answers - 141-152 |
141. What are async and await used for?
Enable non-blocking asynchronous programming for improved responsiveness in I/O-bound operations.
142. What are delegates in C#?
Type-safe function pointers used for callbacks and event handling.
143. What is dependency injection?
A design pattern promoting loose coupling by injecting dependencies instead of hardcoding them.
144. Difference between interface and abstract class?
Interfaces define contracts; abstract classes can provide partial implementation.
145. What is a nullable type in C#?
Allows value types (e.g., int?) to represent null values.
146. What is the var keyword?
Enables implicit typing; compiler infers the type at compile time.
147. Difference between == and .Equals()?
== compares references for objects; .Equals() compares values.
148. What is LINQ?
Language Integrated Query—query collections using SQL-like syntax.
149. What is a lambda expression?
Concise way to write anonymous functions: (x) => x * x
150. What is the params keyword?
Allows passing variable number of arguments to a method.
151. Difference between IEnumerable and IQueryable?
IEnumerable executes in-memory; IQueryable builds expression trees for deferred execution (e.g., LINQ to SQL).
152. Use of Span<T> in C# 13?
Provides high-performance, memory-safe access to contiguous memory regions without allocations.
| WPF-Question-Answers-101-110 :👈 | 👉:C# Threading QA-51-62 |