Java String toUpperCase() method


In this program, You will learn how to implement the String toUpperCase() method in java.


if (a.toUpperCase(b)) { 
    //statement
}

Example: How to implement String toUpperCase() method in java.

import java.util.Scanner;

class Main {
    public static void main(String args[]) {

        Scanner sc = new Scanner(System.in);
        String a, b;

        System.out.print("Enter string value:");
        a = sc.nextLine();

        b = a.toUpperCase();

        System.out.print("String in uppercase value:" + b);

    }
}

Output:

Enter string value:xiith.com
String in uppercase value:XIITH.COM