Java – Variables and Types in Java

In this chapter we will learn how to use variable and datatypes in Java.

the Following are the most commonly use datatypes 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)

The code below shows how to use these datatypes and variables


Partner Sites