Câu hỏi phỏng vấn C#
Câu hỏi

What is Managed or Unmanaged Code?

Câu trả lời

Managed and Unmanaged Code in C#

In C#, managed code and unmanaged code refer to the way code is executed and managed by the Common Language Runtime (CLR) of the .NET Framework.

Managed Code

Managed code is code that runs under the control and management of the CLR. When you compile C# code, it is converted into an intermediate language (IL) code, which is then executed by the CLR. The CLR provides several benefits for managed code, such as:

  1. Automatic memory management: The CLR's garbage collector automatically allocates and releases memory for objects, reducing the risk of memory leaks and other memory-related issues.

  2. Type safety: The CLR enforces type safety, ensuring that objects are used in a manner consistent with their defined types.

  3. Security: The CLR provides a security system that helps protect the system from malicious code.

  4. Exception handling: The CLR provides a consistent exception handling mechanism, making it easier to handle and propag...

junior

junior

Gợi ý câu hỏi phỏng vấn

senior

What is the difference between Func<string,string> and delegate ?

middle

When to use Record vs Class vs Struct in C#?

middle

What is the difference between ref and out keywords?

Bình luận

Chưa có bình luận nào

Chưa có bình luận nào