This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Associate Certification (OCAJP 7/8) and the fly likes char data type and Unicode Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Associate Certification (OCAJP 7/8)
Bookmark "char data type and Unicode" Watch "char data type and Unicode" New topic
Author

char data type and Unicode

Glenn Gould
Greenhorn

Joined: Jul 09, 2013
Posts: 5
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

Joined: Oct 14, 2005
Posts: 19725
    
  10

They can be put into String literals as well:


Ivan Jozsef Balazs
Rancher

Joined: May 22, 2012
Posts: 968
    
    5
A Unicode value is simply an integral value. All these work:

 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: char data type and Unicode
 
It's not a secret anymore!