Normally, when we work with characters, we use the primitive data type char:
char ch = 'a';
// Unicode for uppercase Greek omega character
char uniChar = '\u039A';
// An array of chars
char charArray[ ] = { 'a', 'b', 'c', 'd', 'e' };
In development, we sometimes come across situations where we need to use objects instead of primitive data types.
In order to achieve this, Java provides wrapper class java.lang.Character for the data type char.
The class offers a number of useful class (i.e., static) methods for manipulating characters.
The following script creates two Character objects: (i) one using the Character constructor and (ii) another one using the autoboxing explained in the next slide:
Character ch1 = new Character('a');
Character ch2 = 'a';