Data Types in Java

Data types represents to store the different types of value in variable.There are two types of data types available in Java .

1.Primitive data types
2.Non-primitive data types

1.Primitive data types :
           Primitive data types are used to store single value at a time in variable .

  Example : int i;
                i=0; // valid
                i=0,1; // invalid

   Data types         Size(bits)   Size(byte)

    byte                       8             1
    char                      16           2
    short                     16           2
    int                         32           4
    long                      64           8
    float                      32           4
    double                  64           8
    boolean                  1           -

2.Non-primitive data types :

    String , Array etc

data types

Find us :
        Facebook : @apnaandroid
        Google+   : Apna Java
        YouTube : Android & Java Tutorial

Comments