File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Why char type in java is is having 2 byte of memory?
Joined: Aug 08, 2012
Jan 03, 2013 13:00:58
I mean prior to
, all programming languages were using only 1 byte of memory for CHAR datatype. Then why java offered 2 bytes..?
Joined: Mar 22, 2005
Jan 03, 2013 13:13:36
Prior to Java, no programming language supported Unicode easily; Java does, thus allowing you to handle text in most of this planet's languages and scripts without much work on your part. Pretty cool, huh?
Ping & DNS, my free Android app for network diagnostics
Joined: Oct 13, 2005
Jan 04, 2013 02:37:20
And to add to what Ulf said, when Java was first developed, all Unicode characters occupied 16 bits = 2 bytes.
subject: Why char type in java is is having 2 byte of memory?
question on unicode
Storing serialized objects
Help in Final variables
byte size of a string?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013