Translate

Monday, 9 June 2014

Data Types

Java language has rich implementation of data types.Data type specify the size 
and value that can be stored in an identifier.

In java data types are specified into two category :-
  1. Primitive Data Type
  2. Non-Primitive Data Type
A primitive Data types can be of eight types:-
  1. char
  2. boolean
  3. byte
  4. short
  5. int
  6. long
  7. float
  8. double
Note : -Once a primitive datatype has been declared, its type can never change,although its value can change in most of cases
datatype in java


Data TypeDefault ValueDefault size
booleanfalse1 bit
char'\u0000'2 byte
byte01 byte
short02 byte
int04 byte
long0L8 byte
float0.0f4 byte
double0.0d8 byte


Non-primitive datatype - It is also known as reference data type. Reference
 data type is used to refer an object. A reference variable is declared to be specific and that type can never be changed.

No comments:

Post a Comment