Java toUpperCase() method


Java  Character类Java Character Class


toUpperCase() method is used to convert lowercase characters to uppercase.

Syntax

char toUpperCase(char ch)

Parameters

  • ch -- The characters to be converted.

Return Value

Returns the uppercase form of the converted character, if any; otherwise, returns the character itself.

Example

public class Test {public static void main(String args[]) {System.out.println(Character.toUpperCase('a'));System.out.println(Character.toUpperCase('A'));}}

The execution result of the above program is:

A
A

##Java Character classJava  Character类