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: 

// 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!