java operator

1. Data Type in Java

a. Data Type is most important thing of the class because it is used to store the values.
b. Data is a group of Information.
c. Each and every Information has own type. So java Provide different type of data type to hold different type of values.
d. There are two type of Data Type in Java :

  1. Primitive Data Type
  2. Non-Primitive Data Type

  1. Primitive Data Type

  2. a. Primitive Data Types are Old Data type or Lagecy Data type.
    b. Primitive Data Types are never create instance.
    c. Primitive Data Types are also called variables.
    d. There are following primitive data type:

    Type Size Default Value Range
    boolean 1 bit false true/false
    byte 8 bit 0 -128 to 127
    short 16 bit 0 -32768 to 32767
    char 16 bit \u0000 \u0000 to \uFFFF
    int 32 bit 0 -2147483648 to 2147483647
    long 64 bit 0 -9223372036854775808 to 9223372036854775807
    float 32 bit 0.0 1.4E-45 to 3.4028235E+38
    double 64 bit 0.0 4.9E-324 to 1.7976931348623157E+308
  3. Non-Primitive Data Type

  4. a. Non-Primitive Data Types are New Data type.
    b. Non-Primitive Data Types instance can be created.
    c. Non-Primitive Data Types are also called refrence variables.
    d. There are following non-primitive data type:

    1. Classes : Predefine (String,System,Scanner,Integer,Float,Thread,etc.) User define(Car,MyClass,Demo,Test etc.)
    2. Array : int [],Integer[] etc.
    3. Interface : It just like class.
    4. enum : It is used to define constant.
    5. All non-primitive default value is null.