Sunday, February 22, 2015

C# Basics

Namespace: A Namespace is used to organize your code. It is collection of classes, interfaces, structs, enums and delegates
DataTypes: C# is a strongly-typed language. Before a value can be stored in a variable, the type of the variable must be specified .
The Built in datatypes in C#
  • Boolean type
  • Integral Type
  • Floating Type
  • Decimal Type
  • String Type
Boolean Type: A variable of Boolean type will have values only True or False. The keyword bool is used in defining the datatype
eg: bool X = true;
The Variable X is of type bool and has the value true. If you try to assign any other value to the bool variable X then it will give a compile error

Integral Type: The integral datatypes are used to store  numbers. There are many Integral datatypes 
  •  sbyte 
  • byte
  • short
  • ushort
  • int
  • uint
  • long
  • ulong
  • char
C# datatypes are categorized into two categories
       Value  Datatypes
       Reference Datatypes

No comments:

Post a Comment