Question: // Given the following string declarations, write the output of each statement: String one- Humpty Dumpty, two = Twinkle; System.out.println(one.charAt(4)); System.out.println(one.indexOf(pty)); System.out.println(two.charAt(two.length()-4)); System.out.println(one.substring(4,6) +
// Given the following string declarations, write the output of each statement: String one- "Humpty Dumpty", two = "Twinkle"; System.out.println(one.charAt(4)); System.out.println(one.indexOf("pty")); System.out.println(two.charAt(two.length()-4)); System.out.println(one.substring(4,6) + two.substring(3)); System.out.println(one.replace("pty", "gry")); Give an expression using the two strings one and two above that will evaluate to "humtwin":
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
