Day3 : Datatypes

   Datatypes

There are two types of Datatype in Java one is Primitive and Other is non-primitive datatype. The following flowchart shows a subcategory of Datatypes.


Datatype Name + Size(In Byte) + Range:

  1. Byte - 1 Byte - Range: -128 to +127
  2. Short - 2 Byte - Range: -32,768 to +32,767
  3. Int - 4 Byte - Range: -2,147,433,648 to +2,147,433,647
  4. Long - 8 Byte - Range : -9,223,372,036,854,775,308 to +9,223,372,036,854,775,308
  5. Char - 2 Byte -  Range: 0 to 65535(UNICODE) 
  6. Boolean - 1Byte(8 bit) or 1 Bit - Actually It's size is dependent on JVM some JVM takes 8 Bit Or Some takes 1 Bit
  7. float - 4 Byte - Range: -3.4 * 10^38 to +3.4 * 10^38
  8. double - 8 Byte - Range: -1.7*30^308 to +1.7*30^308

Comments

Popular posts from this blog

Day2 : Compiling Java Program with Examples

Day1: Introduction to Java and its feature

What does System.out.printf( "%-15s%03d\n", s1, x) do?