Java Basics

Primitive Data Types:
byte – 1 byte
short – 2 byte
Int – 4 byte
long – 8 byte

float – 4 byte
double – 8 bye

char – 2 byte

boolean – The size of a boolean is not precisely defined by the Java Virtual Machine Specification.

Typecast:
Implicit typecast:
int a = 10;
double b = a;

Explicit typecast:
double a = 10;
int b = (int)a;