Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Android Security Essentials Live Lessons
this week in the
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 networking tools app
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.
I agree. Here's the link:
subject: Why char type in java is is having 2 byte of memory?
byte size of a string?
question on unicode
Help in Final variables
Storing serialized objects
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014