Java String toUpperCase method

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

if (a.toUpperCase(b)) { 

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(;
        String a, b;

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

        b = a.toUpperCase();

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



Enter string
String in uppercase value:XIITH.COM