Java Character toUpperCase() MethodThe toUpperCase(char ch) method of Character class converts the given character argument to the uppercase using a case mapping information which is provided by the Unicode Data file. It should be noted that Character.isUpperase(Character.UpperCase(ch)) may not always return true for some characters. In actual, the String.toUpperCase() can be used to map the characters into uppercase. There are various benefits of String case mapping as compared to Character case mapping. String case mapping can be used to perform local-sensitive mappings, context-sensitive mappings whereas the Character case mapping cannot be used. SyntaxParameterch: It is the character that needs to be converted. Return ValueThe toUpperCase(char ch)method returns the uppercase of the given character. Otherwise, this method returns the character itself. Example 1Output: The titlecase of character 'm' is given as: M The titlecase of character 'q' is given as: Q Example 2Output: The uppercase of the character '+' is given as: + The uppercase of the character 'F' is given as: F Java Character toUpperCase(int codePoint) MethodThe toUpperCase(int codePoint) method of Character class converts the given character(Unicode code point) argument to the uppercase using a case mapping information which is provided by the Unicode Data file. It should be noted that Character.isUpperase(Character.UpperCase(codePoint)) may not always return true for some characters. In actual, the String.toUpperCase() can be used to map the characters into uppercase. There are various benefits of String case mapping as compared to Character case mapping. String case mapping can be used to perform local-sensitive mappings, context-sensitive mappings whereas the Character case mapping cannot be used. SyntaxParametercodePoint: It is the codePoint which is the character that needs to be tested. Return ValueThe toUpperCase(int codePoint)method returns the uppercase of the given character(Unicode code point). Otherwise, this method returns the character itself. Example 1Output: The uppercase for the character 'f' is given as: F The uppercase for the character 'n' is given as: N Example 2Output: The uppercase for the character 'w' is given as: W The uppercase for the character 'P' is given as: P Next TopicJava-character-valueof-method |