Primitive Data Types
There are 8 Primitive data Types,
- byte - Integers
- char - Integers
- short - Integers
- int - Integers
- long - Integers
- float - Floating Point -- Decimal places
- double - Floating Point -- Decimal places
- Boolean - Binary -- 2 Options -- In java -- True or False
Refer the following,
int a = 5;
long b = 7;
a + b;
Is this statement true?
Yes its true, because both of them are in the type of Integers.
float c = 7.8;
double d = 5;
c + d;
Is this statement true?
Yes its true, because both of them are in the type of Decimal points.
long e = 12345;
float c = 34.87;
e + f;
Is this statement true?
No its false, because they are not in the same type.
- We cant deal with premitive data types in different types only with the same type one's, we can deal.
Integer (Hierarchy/ Ascending order)
- long
- int
- short
- char
- byte
Floating (Hierarchy/ Ascending order)


Comments
Post a Comment