Java Character valueOf() Method
The valueOf(char c)method of Character class returns the instance of the Character which represents the given char value. If the new object of the Character is not required, then the method should be used in preference to the constructor Character(char).
The above method is likely to provide better space and time performance. This method will cache the values in the range of '\u0000' to '\u007F' and there might be some possibilities to cache the other values outside the range.
c: It is the character value that needs to be tested.
The valueOf(char c)method returns the object of Character.
Example 1Test it Now
The character value of the character 'A' is given as: A The character value of the character 'h' is given as: h
Example 2Test it Now
The word 'Hello' can be represented as: H e l l o The word 'Everyone' can be represented as: E v e r y o n e