Data TY PES in
java
Data ty pes
Data ty pes are the different v alues, that can
be stored in the v ariable
There are tw o ty pes
Data
ty pes
Primitive Non - Primitive
By te
String
Short
Array s
Int
Etc..
Long
Float
Double
Boolean
Primitive data
TY PES
[Link] te
Minimum : - 127
Maximum : 127
Default value is 0
[Link]
Minimum : - 32768
Maximum : 32767
Default value is 0
[Link]
W hen you declare a variable as int a =10: it tak es up 4
by tes of memory
Minimum : - 2147483648
Maximum : 2147483643
[Link] g
W hen you declare a variable as long a = 10: it tak es up 8
by tes of memory
Minimum : - 92233720368547775808
Maximum : 92233720368547775808
The choice betw een using int and long should be based on the
range of value you need to store
[Link]
It tak es 4 by tes
Can tak e up 6 to 7 decimal
Ex: 10.345f
[Link]
It tak es 8 by tes
Can tak e up to 15 decimal
Ex: 10.134256194
[Link]
It tak es 2 by tes
Used to store any
character.
[Link]
There are only tw o
possible value
True
False
Than k y ou