Java variables
Here is a list of all primitives in Java:
byte (number, 1 byte)short (number, 2 bytes)int (number, 4 bytes)long (number, 8 bytes)float (float number, 4 bytes)double (float number, 8 bytes)char (a character, 2 bytes)boolean (true or false, 1 byte)EXAMPLES :
To declare and assign a number use :
int number;
number=2; or you can directly use : int number=2;
For Float :
float f = (float) 5.5; or you can use: float f = 4.5f;
For Char :
char c = 'hello';
For String :
String c ="hello programmers" ;
THIS IS THE JAVA VARIABLES.
Comments
Post a Comment