Write a program to convert a string to upper and lower case

Method for convert to lower case:
String.toLowerCase();

Method for convert to UPPER case:

String.toUpperCase();

A simple Java program:

public class Main {
    public static void main(String[] args) {
        String s="Hello Java";
        System.out.println(s.toLowerCase()); //Convert to lower case
        System.out.println(s.toUpperCase()); //Convert to upper case
    }

}
Output:
hello java
HELLO JAVA
about author

admin

salmansrabon@gmail.com

If you like my post or If you have any queries, do not hesitate to leave a comment.

Leave a Reply

Your email address will not be published. Required fields are marked *