
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Store Unicode in a Char Variable in Java
To store Unicode in a char variable, simply create a char variable.
char c;
Now assign unicode.
char c = '\u00AB';
The following is the complete example that shows what will get displayed: when Unicode is stored in a char variable and displayed.
Example
public class Demo { public static void main(String []args) { int a = 79; System.out.println(a); char b = (char) a; System.out.println(b); char c = '\u00AB'; System.out.println(c); } }
Output
79 O «
Advertisements