Write a method that takes a string as its parameter and returnsthe string as follows:
Every uppercase to lowercase and every lowercase to uppercase.(Use API).
Example: given “Hello” should returns “hLLO”.
Solution
import java.util.Scanner;public class FlipCase { public static String flipCase(String s) { String result = “”; for (int i = 0; i <s.length(); i++) { if (Character.isLowerCase(s.charAt(i))) {
OR
OR