My Profile

Friday, January 28, 2011

C# Data Types


  • Integer Types


Note: byte, ushort, uint, ulong can store only unsigned integer values. where as short, int, long, sbyte can store signed values.



  • Float or Decimal Types




  • Boolean Type



  • Character Types


  • Root Type


The size of char type has been increased to 2 bytes providing a support for unicode characters i.e., Multi Language usage support other than english. where the numeric representation of other language character is known as unicode value that requires 2 bytes memory for settle.

String type doesn't have any fixed size because it was a variable length type.

The object type is capable of storing any type of value init and it was also a variable length type.


Syntax for variable declaration:



Examples:

  • int x;
  • string str = "hello";
  • double d1, d2, d3;
  • public bool flag = true;
  • public const float pi = 3.14f; //without "f" it will be treated as decimal and assigning value to const var is mandatory.
  • public readonly int y = 300;



----------------------------------------------------------

** If you like this post please like our page in facebook "Dot Net Support




0 comments:

Post a Comment

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More