ASP.Net Interview Question and Answers

171. What is boxing and unboxing?
  Implicit conversion of value type to reference type of a variable is known as BOXING, for example integer to object type conversion.
Conversion of reference type variable back to value type is called as UnBoxing.
 
Your Name Your Email-ID
Your Answer
172. What is garbage collection?
  Garbage collection is a system whereby a run-time component takes responsibility for managing the lifetime of objects and the heap memory that they occupy.
 
Your Name Your Email-ID
Your Answer
173. What is serialization?
  Serialization is the process of converting an object into a stream of bytes.
Deserialization is the opposite process of creating an object from a stream of bytes. Serialization / Deserialization is mostly used to transport objects.
 
Your Name Your Email-ID
Your Answer
174. What is the differnce between Managed code and unmanaged code?
  Managed Code: Code that runs under a "contract of cooperation" with the common language runtime. Managed code must supply the metadata necessary for the runtimeto provide services such as memory management, cross-language integration, code access security, and automatic lifetime control of objects. All code based on Microsoft intermediate language (MSIL) executes as managed code.

Un-Managed Code:Code that is created without regard for the conventions and requirements of the common language runtime. Unmanaged code executes in the common language runtime environment with minimal services (for example, no garbage collection, limited debugging, and so on).
 
Your Name Your Email-ID
Your Answer
175. What is difference between constants, readonly and, static?
 
  • Constants: The value can’t be changed.
  • Read-only: The value will be initialized only once from the constructor of the class.
  • Static: Value can be initialized once.
 
Your Name Your Email-ID
Your Answer