File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Android Security Essentials Live Lessons this week in the Android 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: 18541
    
    8

They can be put into String literals as well:


Ivan Jozsef Balazs
Rancher

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

 
jQuery in Action, 2nd edition
 
subject: char data type and Unicode
 
Similar Threads
Increment a character...
K&B Java 1.4 Study Guide error on page 16 Scenario & Solution
char primitive initialization values
What is the range for unicode values in char data type?
Char