Showing posts with label C# support data types. Show all posts
Showing posts with label C# support data types. Show all posts

Saturday, September 10, 2011

Predefined Data Types

These data types are divided into 4 types.
  • Integral Data Types
  • Floating Data Types
  • Character Data Types
  • Other Data Types

Difference between in Reference and Value Data Type

  • Value Types
  • Value types hold the data directly.
  • Value types do not have default value.
  • Value types will be stored in stack memory at compile time.
  • Stack is faster in accessing
  • Stack is not accessible to garbage collector. Hence it will not be cleared at runtime.
  • Value type passes an exact copy to methods.
  • Example: Implicit Data Types, Structures, Enumerations.

  • Reference Types
  • Reference types do not hold the date directly.
  • Reference types have default value.
  • Reference types will be stored in heap memory at run-time.
  • Heap is slower in accessing.
  • Heap is accessible to garbage collector. Hence at run-time heap can be cleared.
  • Reference types passes a reference (handle) to methods.
  • Example: Classes, Objects, Arrays, Delegates, Interfaces.
Read about Data types

Data Types in C hash dot net

Type specifies the type of the data and the size of the data.
Working with Data Types: Data Type specifies the type of the data and the size of the data.

C# supports two types of Data Types:

C# supports two types of data or we can say that, we can use two types of data types in C#.Net

  1. Value Type
  2. Reference Type
DATA TYPES

Popular 5 Posts Last 7 days