Practice question
3 marksWhat is the output of: String s = "Computer"; System.out.println(s.substring(2, 5) + s.length() + s.charAt(0));
String HandlingMediumNumerical
Computer Science · Class 11 · ISC
The String class, its methods, immutability, and common string manipulation problems.
5questions
Syllabus mapping: ISC syllabus (CISCE) (opens CISCE's website in a new tab)
5 questions
Practice question
3 marksWhat is the output of: String s = "Computer"; System.out.println(s.substring(2, 5) + s.length() + s.charAt(0));
String HandlingMediumNumerical
Practice question
3 marksWhat is the output of: String s = "Examination"; System.out.println(s.length() + " " + s.substring(0, 4) + " " + s.toUpperCase().charAt(2));
String HandlingMediumNumerical
Practice question
3 marksWrite a Java program segment to check whether a given string s is a palindrome.
String HandlingMediumApplication based
Practice question
3 marksWrite a Java program segment to print the first letter of every word of a sentence s with single spaces between words.
String HandlingMediumApplication based
Practice question
3 marksExplain what is meant by saying that String objects in Java are immutable, and name the class to use when a mutable string is needed.
String HandlingMediumShort answer