Basic data type
Variables are nothing butreserved locations to store values.thIS means that
When you create a variable you reserve some space in memmory.
Based on the data type of variable the operating system allocates memmory
And decides what can be stored in the reserved memmory.there fore by
Assigning different data types to variables.you can store integers ,decimals,
Or character in these variables.
There are two data types available in java
Primitive data type
Non-primitive data type
Primitive data type
There are eight primitive data types supported by java.primitive data types are
Predefind.by the language and named by a keyword.let us now look into detail
About eight primitive data types.
Byte
Byte data type is an 8 bit signed two is compliment integer
Minimum value is 128
Maximum value is 127
Defult value is 0
Byte data type is used to save space in large arrays,mainly in place of
integers,since a byte is four times smallen than an int
Example byte =100,byte b=-50
Short
Short datais a 16-bit signed two’s complement integer
Variables are nothing butreserved locations to store values.thIS means that
When you create a variable you reserve some space in memmory.
Based on the data type of variable the operating system allocates memmory
And decides what can be stored in the reserved memmory.there fore by
Assigning different data types to variables.you can store integers ,decimals,
Or character in these variables.
There are two data types available in java
Primitive data type
Non-primitive data type
Primitive data type
There are eight primitive data types supported by java.primitive data types are
Predefind.by the language and named by a keyword.let us now look into detail
About eight primitive data types.
Byte
Byte data type is an 8 bit signed two is compliment integer
Minimum value is 128
Maximum value is 127
Defult value is 0
Byte data type is used to save space in large arrays,mainly in place of
integers,since a byte is four times smallen than an int
Example byte =100,byte b=-50
Short
Short datais a 16-bit signed two’s complement integer