In this video, the four methods are explained with two programs and application of startsWith() and endsWith() is explained with the help of one program in the Java environment.
Link to the Book - Essentials of Computer Applications:
https://www.amazon.in/Essentials-Comp...
Practice Exercise Lesson 65 toUpperCase(), toLowerCase(), startsWith() and endsWith()
1. Read a string and find its length and convert into Uppercase and display.
2. Read a string and display the first character and convert the string into lowercase and display.
3. Guess output of the following code.
System.out.println(“Hello”.toUpperCase());
4. Guess output of the following code.
String x = “THIS IS A BOOK”; System.out.println(x.toLowerCase());
5. System.out.println(“Respect your elders”.startsWith(“your”));
System.out.println(“Respect your elders”.endsWith(“elders”));
6. String x = “Strings are easy to print”;
System.out.println(x.startsWith(“Strings”));
7. String x = “Strings are easy to access”; String y = “access”;
boolean b = x.endsWith(y);
System.out.println(b);
8. System.out.println(“Language is important to express ideas”.startsWith(“L”));