Friday 1 June 2012

Difference between primitive type and non primitive data type in C#

There are two types of data type in C#

primitive data types are the datatypes which are not objects as they are present in c and c++. eg.int,char,float etc.
where as non primitive are the datatypes which are considered as objects eg. String.
This is one of the reason why java is not a purely object oriented lang as the primitive data types are also allowed in java


  1.   Primitive types (or) predefined
  Ex:  byte, short, int, float, double, long ,char, bool, DateTime, string, object etc..

 2.   Non-primitive types (or) User Defined
 Ex: class , struct , enum , interface,  delegate, array.

No comments:

Post a Comment