Java String.toUpperCase() Method

Java String.toUpperCase() Method

By Yashwant Chavan, Views 912, Date 16-Nov-2016

In this tutorial you will learn about String.toUpperCase() method. It converts all of the characters in this String to upper case.

tags java

Refer below steps

  • String.toUpperCase() converts all of the characters in this String to upper case using the rules of the default locale.
  • Returns: The String, converted to uppercase.

Java String.toUpperCase() method example

package com.technicalkeeda.app;

public class StringToUpperCase {

    public static void main(String args[]) {
        String hello = "hello";
        System.out.println(hello.toUpperCase());
        hello = "hEllo";
        System.out.println(hello.toUpperCase());
        hello = "HeLLo";
        System.out.println(hello.toUpperCase());
    }
}

Output

HELLO
HELLO
HELLO

Suggested Posts

Yashwant

Yashwant

Hi there! I am founder of technicalkeeda.com and programming enthusiast. My skills includes Java,J2EE, Spring Framework, Nodejs, PHP and lot more. If you have any idea that you would want me to develop? Lets connect: yashwantchavan[at][gmail.com]