• Post Reply Bookmark Topic Watch Topic
  • New Topic

char data type and Unicode

 
Glenn Gould
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Java, is char the only data type that Unicode can be assigned to?

For example,

char d = '\u003E';

Can the Unicode characters on the R.H. side of the assignment be assigned to another data type?
 
Paul Clapham
Sheriff
Posts: 21972
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They can be put into String literals as well:


 
Ivan Jozsef Balazs
Rancher
Posts: 992
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A Unicode value is simply an integral value. All these work:

 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!