Java Data Type

 Java have two Data types  

  • Primitive data types  Ex : 
    • Primitive data types in Java can be divided into three main categories:

      • Integral types : represent signed integers (byte, short, int, long) and unsigned character values (char)

      • Floating point types : (float, double) : represent fractional signed numbers

      • Boolean type  (boolean) : represent logical values (true , false)

  • Non-primitive data types Ex :
    •  String, Arrays and Classes

How To Use Data Type and  Declaring and Initializing Variables   

     byte b = 127 ; 
     short v = 32767;
     int bb = 2147483645 ; 
     long  vv = 9223372036854775807L;     
     char l = 'D';
     String name = "ajalks sdjksdskldd skdsk897878d 8789ds" ;   
    
     float fv  = 12.12f ;
     double df = 3232.323232 ;
     
     boolean nm = true;
     boolean nv = false;    
    
     String j = "java 99"; //  Declaring and Initializing Variables     
     
     Code Here





Post a Comment

Previous Post Next Post

Featured Post