DataType In Java Language

java






DataType In Java Language


intiger (int) => int store a number value


String  (String) => String store a group of charater


float  (float) => float store a point value


charater (char) => char store a single charater 


boolean  (boolean) => boolean store true or false only  




//********************************************************


Syntax:- dataType variableName = value ;


//********************************************************



Example :-


         dataType    variableName =      value ;

         int          name        =        23   ; 

String       name        =       "ankit";

float        name        =       23.5f;

char         name        =       'a';

boolean      name        =      true or false;



 simple program to understand the variables in java


     


/* there are two type of data type
* primitive -byte(byte1), short(byte2), char(byte2), int(byte4), long(8), float(4), double(8), boolean(1bit)
* non primitive = user can define the data type 

Tags

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.