The Character class is used to manipulate individual characters.
The Character class wraps the value of a base type char in an object
char ch = ' A '// Unicode character representation char unichar = ' \u039a '; // character Array Char [] Chararray ={' A ', ' B ', ' C ', ' d ', ' e '};
However, in the actual development process, we often encounter situations where objects need to be used rather than built-in data types. To solve this problem, the Java language provides the wrapper class character class for the built-in data type char.
The character class provides a series of methods to manipulate characters. You can create a character class object using character's construction method, for example:
New Character (' a ');
In some cases, the Java compiler automatically creates a character object.
For example, when a parameter of type char is passed to a method that requires a character type parameter, the compiler automatically converts the char type parameter to the character object. This feature is called boxing , which in turn is called unpacking .
// the original character ' a ' is boxed into the Character object ch Character ch = ' A '// raw character ' X ' is boxed with the test method / / Returns the value of the unboxing to ' C 'char c = Test (' x ');
Escape Sequences
Character Method
JAVA Character Class