Tuesday 7 August 2012

DATA TYPE IN C# !!

                             Data Type In C#

Data Types is  describes that what type of data a variable can hold .Every variable in C# is a associated with a data type.Data type specify the size and type of value that can be store in C# is a language rich in its data types.

C# commonly divided into three categories which are as give below:=>

  1. Value Type.
  2. Reference Type.
  3. Pointer.
The diagram of the data type that is how it categorize as give below :=>


                                                                     
Value Type:=>
                 Value Type which are of fixed length are stored on the stack and when a value of a variable is assigned to another variable ,the value is actually copied.This mean the two identical copies of value available in memory.

The value type in C# is further group into two categories :=>

  1. User-Define Type or complex Type
  2. Predefine Type or Simple Type .
User-Define value Type:=>
                            User-Define value which we can use own complex type is known as user-define data type which is include struct type and enumeration.

Predefine value  Type:=>
                           Predefine value type are also called simple type which are further subdivided as five below.
  • Numeric Type.
  • Boolean Type.
  • Character Type.
Further Numeric Type include integral type,floating type and decimal type.
Further integral subdivided into signed type and unsigned  types.

Numerical Type=>
                  Numerical Type include integral type,floating point and decimal types.These are shown diagrammatically ....
Integral Type:=> 
  •   Integral Type can hold whole number such as 123,-96 and 5639.
  •   The size of the values that can be stored depends on the integral data type we choose .
Signed Integer:=>
                    =>Signed Integer Type can hold the both positive and negative numbers.

The memory size and range of all the four signed integer data type is given below.


Now diagram of the Signed integer is given below:=>


Unsigned integers:=>
  • We can increase the size of the value stored in an integers by making it unsigned.for example a 16 bit short integer can store values in the range -32,768 to 32,767.However by making it unshort ,it can handle values in the range of o to 65,535.
The size and range of all the four unsigned integer data type is given below..

Now the diagram of the unsigned integers is given below :->

Floating point Type :=>
                         Integer type can hold only whole numbers and therefore we use another type known as floating point type to hold number  containing functional part such as27.59 and -1.375.
There are two kind of floating point store in C#:=>
  1.   float type values.
  2. double types 
Float type values:=>
              The float type value are single-precision number with a precision of seven digits
Double Type values:=>
              The double type value represent  double-precision with a precision of 15/16 digits.

=>Double -precision type are used when we need greater precision in storage of floating point numbers.
=>Floating point data type are support a special value known as Not a Number (NaN).
NaN:=>NaN(Not a Number ) is used to represent the result of operators such as dividing by dividing.Where actual value is not produce.

Decimal Type:=> 
  •  The decimal type is a high precision 128-bit data type that is design for use in financial and monetary calculation.
  • It can store values in the range 1.5*10^-28 to 7.9*^28 with 28 significant digits 
  • To specify a number to be decimal type we must append the character M(or m) to the value like 123.45M.If we omit  M the value will be treated as double .
Character Type:=>
                In order to store single characters in memory  c# provides a character data  type called char .A char is assumes a size of two byte  but in fact it can hold only a single character.it has been design for  hold a 16 bit Unicode character .

Boolean Type:=>
                           Boolean type is used when we want to test a particular condition during the execution of the program.There are only two type of boolean that is true and false.Remember this this two word declare as keywords.Boolean type is denoted by the keyword bool.


Reference Type !!
Reference Type also divided into two group which is given below:
  1. User-Define (complex) Types 
  2. Predefined (Single ) Types.
User-Define Types:
               User-Define Types refer to those type which we define using predefined types.They includes 
  • Classes 
  • Delegates 
  • Interfaces
  • Arrays
Predefines Types:
            Predefined include two data types
1) Object Type
2)String Type.

Object Type:
           The object type is the ultimate base type of all other intrinsic and user define type in C#.
String Type:
          The string data type in c# provide its own string  type for creating  and manipulating strings 

Now !! You can download the copy of this article which created in Microsoft Word by click on below download link.

I hope this post will help you !!

If still you have some query regarding to this article then please post your comment after that 1 will 100 % help you...

5 comments:

It is really a great work and the way in which u r sharing the knowledge is excellent.Thanks for helping me to understand basic concepts. As a beginner in Dot Net programming your post help me a lot.Thanks for your informative article.
dot net training and placement in chennai | dot net training center in chennai

It is extremely an awesome work and the manner by which u r sharing the learning is excellent.Thanks for helping me to comprehend fundamental ideas. As a novice in Dot Net programming your post help me a lot.Thanks for your enlightening article.
Education

This is exactly what I wanted to read, hope in future you will continue sharing such an excellent article.

JAVA Training in Chennai
JAVA Course in Chennai

Thanks for Providing such a useful information's about Selenium training...Your Valuable effective work is helps in so many people life.Looking for more Updates Regarding This...
Java training in chennai | Java training in annanagar | Java training in omr | Java training in porur | Java training in tambaram | Java training in velachery

Post a Comment

Hey thanax alot to comment i will revert you back soon...

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites