• Post Reply Bookmark Topic Watch Topic
  • New Topic

unicode  RSS feed

 
saravanan ragunathan
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i studied that char datatypes for example 'g' stores in unicode format.....
i have a confusion that all characters i have typed in a program are stored in unicode format or not..
ifnot what is the use of storing the char type only in unicode format
for example in the following pgm

i have thought that each character i have typed in this pgm is stored in unicode format.. (for example each character in public)this is wright or wrong...






 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java stores characters as Unicode (specifically, an unsigned 16-bit integer per character which represents the code units of UTF-16). So yes, all Strings declared in a Java program are Unicode. Have a read of this very good article.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I *think* the OP is asking about the source code itself.
 
Campbell Ritchie
Marshal
Posts: 56570
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All your questions can be answered if you look in the Java™ Language Specification (JLS). The answer will be there.

You might not understand it, but it's still there.




Actually I think that particular JLS chapter is very easy to understand.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!