Write a Java program segment to change the case of every letter of a string s.
String Handling
Original Khojo Papers practice question — not from a past board paper.
int c = 0; String v = "aeiouAEIOU"; for (int i = 0; i < s.length(); i++) if (v.indexOf(s.charAt(i)) >= 0) c++; System.out.println(c);
No citable source has been recorded for this record. Treat it as practice material, not as fact.
indexOf returns −1 when the character is not found, so a non-negative result means the character is a vowel.
From the same topic and chapter, at a similar level.
Write a Java program segment to change the case of every letter of a string s.
String Handling
Write a Java program segment to count the words in a sentence s that has single spaces between words.
String Handling
State three differences between the String and the StringBuffer classes.
String Handling
What is the output of: String s = "Programming"; System.out.println(s.indexOf('g') + " " + s.lastIndexOf('g') + " " + s.replace('g', 'G'));
String Handling
What is the difference between s1 == s2 and s1.equals(s2) for two String references?
String Handling
State and verify the absorption law X + X·Y = X using a truth table.
Boolean Algebra