Question: Show what is printed by the following program segment: String first Abe; String last ToddLincoln; String middle = Q; char myex='Z'; int i, j

Show what is printed by the following program segment: String first "Abe"; 

Show what is printed by the following program segment: String first "Abe"; String last "ToddLincoln"; String middle = "Q"; char myex='Z'; int i, j i last.length(); boolean b= (last.compareTo("Twain") < 0); System.out.println(i+*+b); i=first.indexOf("odd"); J=last.lastIndexOf('o', 7); System.out.println(i++); first "Mary++ last.substring(0,4); last=" last last.concat("Lincoln"); System.out.println(first+*+ middle +*+ last); StringBuilder str = new StringBuilder(first); str.delete(0,2); str.insert(0,"Har"); System.out.println(str +*+ first); charl mystr last.toCharArray(); mystr[6] = myex; mystr[1] += 2; middle= String.valueOf(mystr); System.out.println(middle):

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!