1.

Explain about types of Common Type System(CTS).

Answer»

Common TYPE System(CTS) standardizes all the datatypes that can be used by different programming languages under the .NET framework.

CTS has two TYPES. They are:

  1. Value Types: They contain the values that are stored on a stack or allocated inline within a structure. They are divided into :
    • Built-in Value Types - It includes primitive data types such as Boolean, Byte, Char, Int32, ETC.
    • User-defined Value Types - These are defined by the user in the source code. It can be enumeration or structure.
    • Enumerations - It is a set of enumerated values stored in the form of numeric type and are represented by labels.
    • Structures - It defines both data(fields of the structure) and the methods(operations performed on that data) of the structure. In .NET, all primitive data types like Boolean, Byte, Char, DateTime, Decimal, etc., are defined as structures.
  2. Reference Types: It Stores a reference to the memory address of a value and is stored on the heap. They are divided into :
    • Interface types - It is used to implement functionalities such as testing for equality, comparing and sorting, etc.
    • Pointer types - It is a variable that holds the address of another variable.
    • Self-describing types - It is a data type that gives information about themselves for the sake of garbage collectors. It includes arrays(collection of variables with the same datatype stored under a single name) and class types(they define the operations like methods, properties, or events that are performed by an object and the data that the object contains) like user-defined classes, boxed value types, and delegates(used for event handlers and callback FUNCTIONS).


Discussion

No Comment Found