toUpperCase() Method In Java

We are going for using toUpperCase() method. This method is explained as follows:

Description of program:

Here, you will see the procedure of converting letters of the string in uppercase letter. So, we are using toUpperCase() method of the String class for the purpose.

program convert the string “america” into “AMERICA” by using toUpperCase() method.

toUpperCase(): This method returns a string value.

Here is the code of this program:

public class ConvertToUpperCase{
public static void main(String args[]){
String Deva= “america”;
System.out.println(“Main String is : ” + Deva);
String upperletter = Deva.toUpperCase();
System.out.println(“uppercase letter is : ” + upperletter );
}
}

Enjoy Code…