Java Character valueOf() MethodThe 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. SyntaxParametersc: It is the character value that needs to be tested. Return ValueThe valueOf(char c)method returns the object of Character. Example 1Output: The character value of the character 'A' is given as: A The character value of the character 'h' is given as: h Example 2Output: 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 Next TopicJava character getname method |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India