Reversed Case of Char Array Program in Java

Define a class to accept a string, and print the characters with the uppercase and lowercase reversed, but all the other characters should remain the same as
before [10]
EXAMPLE:
INPUT: WelCoMe_2022
OUTPUT: wELcOmE_2022


import java.util.Scanner;
public class ReversedCase
{

    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        String st;
        String newSt = "";
        System.out.print("Enter a string:");
        st = sc.nextLine();
        int l = st.length();
        for (int i = 0; i < l; i++)
        {
            if (Character.isUpperCase(st.charAt(i)))
            {
                newSt = newSt + Character.toLowerCase(st.charAt(i));
            }
            else if (Character.isLowerCase(st.charAt(i)))
            {
                newSt = newSt + Character.toUpperCase(st.charAt(i));
            }
            else
            {
                 newSt = newSt + st.charAt(i);
            }
        }
        System.out.println(newSt);
    }
}


Output:

Enter a string:WelCoMe_2022
wELcOmE_2022