Java String toUpperCase()

The java string toUpperCase() method returns the string in uppercase letter. In other words, it converts all characters of the string into upper case letter.

The toUpperCase() method works same as toUpperCase(Locale.getDefault()) method. It internally uses the default locale.


Internal implementation


Signature

There are two variant of toUpperCase() method. The signature or syntax of string toUpperCase() method is given below:

The second method variant of toUpperCase(), converts all the characters into uppercase using the rules of given Locale.


Returns

string in uppercase letter.


Java String toUpperCase() method example

Test it Now

Output:

HELLO STRING

Java String toUpperCase(Locale locale) Method Example 2

Output:

HELLO STR?NG
HELLO STRING




Latest Courses