3. .NET Questions Flashcards
What is CLR?
Common Language Runtime: the virtual machine component of Microsoft’s .NET framework and is responsible for managing the execution of .NET programs. In a process known as just-in-time (JIT) compilation, the CLR compiles the intermediate language code known as Common Intermediate Language (CIL) into the machine instructions that in turn are executed by the computer’s CPU. The CLR provides additional services including memory management, type safety and exception handling. All programs written for the .NET framework, regardless of programming language, are executed by the CLR.
What is FCL?
Framework Class Library is a collection of reusable classes, interfaces, and value types.
What is BCL?
Base Class Library provides the most foundational types and utility functionality and are the base of all other .NET class libraries. It aims to provide very general implementations without any bias to any workload.
What is .NET?
.NET is a managed execution environment to build and run applications.
What is managed code?
Managed code is what C# compilers create. It runs on the CLR, which among other things offer services like garbage collection, runtime type checking, and reference checking.
What is unmanaged code?
Code not managed by the CLR, which compiles straight to machine language.
Are boxing and unboxing generally a good practice?
No.
What is boxing?
A process of converting a value type to the type of an object. When the CLR boxes a value type, it wraps it inside an object and stores it under a managed heap. In general, boxed values use more memory and take a minimum of two memory look-ups to access.
eg.
int i = 123;
object o = i;
~~~
~~~
What is unboxing?
A process of extracting a value type from an object.
eg.
o = 442;
i = (int)o;
~~~
~~~