In this example we will show the method to convert strings to uppercase and lowercase in Java.
Source Code
package com.beginner.examples;
public class UpperLower {
public static void main(String[] args) {
String str = "Good!";
System.out.println(str.toUpperCase()); // convert strings to uppercase
System.out.println(str.toLowerCase()); //convert strings to lowercase
}
}
Output:
GOOD!
good!