Datatypes in Java
Datatypes in Java
byte 0 1 byte
short 0 2 byte
int 0 4 byte
long 0L 8 byte
• For example:
Byte = 1 byte=8 bits
-28-1 To 28-1 -1
-128 to +127
byte num=-129 (not accepted)
byte num=128 (not accepted)
Unicode
• Unique code for each character
• We can use any language character
• Can be categories in
UTF-8. UTF-16 and UTF-32
Unicode Transformation Format
UTF-8 means: 28 =256 types of character supported
UTF-16 means: 216 =65536 types of characters
UTF-32 means: 232 = 4294967296 types of charcters
• As compare with ASCII (American Standard Code
Information Interchange) , ASCII support only 256