Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
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
