Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

java
communitycreator

What is String.toUpperCase() in Java?

Harris Amjad

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

The toUpperCase() function converts a string to uppercase.

The following figure shows a visual representation of the toUpperCase() function.

Visual representation of the toUpperCase() function

Syntax

String toUpperCase()

// Usage
string_1.toUppercase()

Parameter

The toUpperCase() function does not require a parameter.

Return value

The toUpperCase() function returns a string that is converted to uppercase.

Code

class JAVA {
public static void main( String args[] ) {
String string="educative";
String string_1="Educative09";
//to uppercase string
System.out.println("string.toUpperCase():");
System.out.println(string.toUpperCase());
//to uppercase string and number
System.out.println("string_1.toUpperCase():");
System.out.println(string_1.toUpperCase());
}
}

RELATED TAGS

java
communitycreator

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring