Menu
Topics Index
...
`


Datatypes > Primtive Dataypes > Literals >
Siva Nookala - 11 Apr 2016
Character Literals In Java are used for primitive data type char. Character Literals Are included in a single quotation ('ex') marks. Java Character Literals are 16-bit (2-bytes) Unicode characters, ranging from 0 to 65535.

e.g.,
char c = 'a';
char A = '\u0041'; //'u0041' is uni code for capital A
char special_char = '@';
char M = '\u004D'; //'u004D' is uni code for capital M
char leftSquareBracket = '\u005B'; //'u005B' is uni code for left square bracket '['
char hash = '#';

0
Wrong
Score more than 2 points

© meritcampus 2016 - 2017

All Rights Reserved.