Java String.toUpperCase() Method

 Posted On  | Yashwant Chavan 

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

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


© technicalkeeda.com 2017

 |  Find us on Google+ |  Rss Feed

Loaded in 0.0332 seconds.