what is datatype?
Defines what type of data your variable will hold. Means depending upon the type of data, datatype is associated with the variable.
Example:
If you want to store whether user is login or not, use Boolean.
In this video we will discuss integer datatypes in detail which are as follow.
integers data types:
Byte
short
int
long
What are integers in java?
whole numbers that starts from the 0 to infinite, but in java they are finite.
Can be positive or negative.
Byte?
byte's width is 1 byte i.e. 8 bits.
its range is from -128 to 127.
Short?
short's width is 2 byte i.e. 16 bits.
its range is from -32768 to 32767.
Int?
int's width is 2 byte i.e. 16 bits.
its range is from -2147483648 to 2147483647.
long?
long's width is 2 byte i.e. 16 bits.
its range is from -9223372036854775808 to 9223372036854775807.
NOTE:
width is the size of memory each datatype occupies.
range is the minimum and maximum values that a datatype can hold.
On this page of the site you can watch the video online integers in java with a duration of hours minute second in good quality, which was uploaded by the user Gua Java 04 October 2022, share the link with friends and acquaintances, this video has already been watched 16 times on youtube and it was liked by 2 viewers. Enjoy your viewing!