.NET - .NET Framework

33.
What is difference between System.String and System.StringBuilder classes?
String and StringBuilder classes are used to store string values but the difference in them is that String is immutable (read only) by nature, because a value once assigned to a String object cannot be changed after its creation. When the value in the String object is modified, a new object is created, in memory, with a new value assigned to the String object. On the other hand, the StringBuilder class is mutable, as it occupies the same space even if you change the value. The StringBuilder class is more efficient where you have to perform a large amount of string manipulation.

34.
Describe the roles of CLR in .NET Framework.
CLR provides an environment to execute .NET applications on target machines. CLR is also a common runtime environment for all .NET code irrespective of their programming language, as the compilers of respective language in .NET Framework convert every source code into a common language known as MSIL or IL (Intermediate Language).

CLR also provides various services to execute processes, such as memory management service and security services. CLR performs various tasks to manage the execution process of .NET applications.

The responsibilities of CLR are listed as follows:

  • Automatic memory management
  • Garbage Collection
  • Code Access Security
  • Code verification
  • JIT compilation of .NET code

35.
What is the difference between int and int32.
There is no difference between int and int32. System.Int32 is a .NET Class and int is an alias name for System.Int32.