Java String toUpperCase() method


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


if (a.toUpperCase(b)) { }


Example: How to implement String toUpperCase() method in Java

Run it Now
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("\nUppercase Value :" + b);

    }
}

Output:

Enter String Value :xiith
Uppercase Value :XIITH