wood burning stoves*
The moose likes Associate Certification (OCAJP 7) 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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Associate Certification (OCAJP 7)
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
Bartender

Joined: Oct 14, 2005
Posts: 18110
    
    8

They can be put into String literals as well:


Ivan Jozsef Balazs
Rancher

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

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: char data type and Unicode
 
Similar Threads
K&B Java 1.4 Study Guide error on page 16 Scenario & Solution
char primitive initialization values
Char
What is the range for unicode values in char data type?
Increment a character...