freetimestudys@gmail.com          +91-7097633380
  Login Here                        

toUpperCase() and toLowerCase():-

String toLowerCase(): This method converts all the characters of the string into lower case, and returns the lower-cased string.
Example: String str1 = “HELLO“;
System.out.println(str1.toLowerCase());
Output: hello

String toUpperCase(): This method converts all the characters of the string into upper case, and returns the upper-cased string.
Example: String str1 = “hello “;
System.out.println(str1.toUpperCase());
Output: HELLO 

toUpperCase() and toLowerCase():-

class Test
{
public static void main(String[] args)
{
String str="freetimestudy HOW R U";
System.out.println(str.toUpperCase());
System.out.println(str.toLowerCase());
System.out.println("FREETIMESTUDY ".toLowerCase());
}
}

intput and output

output;FREETIMESTUDY HOW R U,,freetimestudy how r u,,freetimestudy