Loading...
Java

Char Data Type

Char Data Type:
In previous languages like C and C++ are ASCII code based the number of ASCII code characters are <256 to represent these 256 characters 8-bits enough hence char size in old languages is 1 byte.
Java allows to use any worldwide alphabets character and java is Unicode based and number of unicode characters are >256 and <=65536 to represent all these characters one byte is not enough compulsory we should go for 2 bytes.
Size: 2 bytes
Range: 0 to 65535

Leave a Reply

Your email address will not be published. Required fields are marked *