Write a Java program to convert all the characters in a string to uppercase.

Java Programming Language / String in java

681

Program:

public class Exercise {

   public static void main(String[] args)
    {
        String str = "The Quick BroWn FoX!";

        // Convert the above string to all uppercase.
        String upper_str = str.toUpperCase();

        // Display the two strings for comparison.
        System.out.println("Original String: " + str);
        System.out.println("String in uppercase: " + upper_str);
    }
}

Output:

Original String: The Quick BroWn FoX!
String in uppercase: THE QUICK BROWN FOX!
Press any key to continue . . .

Explanation:

None

This Particular section is dedicated to Programs only. If you want learn more about Java Programming Language. Then you can visit below links to get more depth on this subject.