Common Type System


  • As we know that in Managed code execution process .Net supports many programming languages
  • Every programming language has its own data types
  • One programming language  cannot understand other programming languages data types
  • But CLR will execute all programming language’s data types, this is because  CLR will contain its own data types, which is common to all programming languages
  • At the time of compilation all language specific data types are converted into CLR’s Data Type
  • This Data Type System of CLR which is common to all programming languages of .Net is known as Common Type System
  • This common type system is divided in two categories
           Value types
           Reference types


    Value Types

  • The data types which store the data directly into the memory locations is known as value types

     Reference Types

  • The data types which do not  store the data directly into the memory locations rather refer to other memory locations is known as reference types
Difference between Value Types and Reference Types

SNo
VALUE TYPES
REFERENCE TYPES
01
Store the value directly into their Memory Locations
Do not Store the value directly into their Memory Locations, rather refers to other memory location where value is stored
02
Memory is allotted at Compile time
Memory is allotted at Run Time
03
Memory allocation is made with in the stack i.e. in contiguous Memory Locations
                      

Memory allocation is made with in the heap i.e. in Random Memory Locations




04
CLR does not provide Automatic Memory Management
CLR provides Automatic Memory Management

Boxing

  Boxing is a process of converting a variable from value type to reference
UnBoxing

   Unboxing is the process of converting a variable from reference type to value type


No comments:

Post a Comment

Translate