VOOZH about

URL: https://www.geeksforgeeks.org/java/java-string-touppercase-method-with-examples/

⇱ Java String toUpperCase() Method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Java String toUpperCase() Method

Last Updated : 11 Jul, 2025

Java String toUpperCase() method of String class is used to convert all characters of the string into an uppercase letter.

Example:


Output
GEEKSFORGEEKS

Note: Lowercase is done using the rules of the given Locale.

There is 2 variant of toUpperCase() method. The key thing that is to be taken into consideration is toUpperCase() method worked the same as to UpperCase(Locale.getDefault()) method as internally default locale is used. 

Java String toUpperCase(Locale locale)

The toUpperCase(Locale locale) method returns a new String object which is the original string in upper case with respect to the Locale method parameter. 

Syntax String toUpperCase() Method in Java

public String toUpperCase(Locale loc)

Parameters:

  • Type 1 : Locale value to be applied as it converts all the characters into
  • Type 2 : NA

Example:


Output
GEEKS FOR GEEKS
GEEKS FOR GEEKS
Comment
Article Tags: