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
|1||byte||1 byte||-128 to 127|
|2||short||2 byte||-32768 to 32768|
|3||int||4 byte||More than short|
|4||long||4 byte||More than int|
Program in Integer Data Types:
Title: Primary Data Type – Integer
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.
Share and Enjoy
246total visits,2visits today