Primitive Data Types – Integer

Primitive Data Types in Java – Integer

Primitive data types are very important in any language. Without this data types we cannot understand  programming language. We can also called primary data types in java. In this primitive data types we found four types of family like Integer, Float, Character and Boolean. And these families have their own children like Integer [byte, short, int and long], Float [float, double], Character [char] and Boolean [Boolean].

In this blog we will discuss on Integer Family:

Integer Data Type

NoData TypesSizeRang
1byte 1 byte-128 to 127
2short 2 byte-32768 to 32768
3int 4 byteMore than short
4long4 byteMore than int


Program in Integer Data Types:

Title: Primary Data Type – Integer

class data1


public static void main(String args[])


byte b1 = 45;


byte b2 = (byte)130;


// **** short Ex ***

short s = 4543;









You can also see this program in YouTube.



Tutorial – Try Yourself

Tutorial – 1 : Find the volume of cube.

Tutorial – 2 : Find sum and average of 6 numbers.

Tutorial – 3 : Find CM And M Form Kilometer. [Need long integer..]




If you have problem on this blog, you can directly comment on it.

How to Set Environment Variable | How to Earn Money Online

410total visits,1visits today


Hello, I am Maddy a Java blogger, trainer and developer

Related articles

Comments are closed.