Question: Q 5 ( 1 0 marks ) : Suppose that 5 1 and 5 2 are given as follows: StringBuilder s 1 = new StringBuilder

Q5(10 marks): Suppose that 51 and 52 are given as follows:
StringBuilder s1= new StringBuilder("Java");
stringBuilder s2= new StringBuilder("HTML");
Show the value of 51 after each of the following statements.
Show the value of char c in part e and String s3 in part j.
The statements are independent. Each part should use the original value of s1.
a. s1_append(" is fun");
b.51.append (52);
c. s1.insert (2,"is fun");
d. s1.insert (1, s2);
e. char c= s1. rharAt (2);
f. s1.deleterharat (3);
g. s1.delete (0,2);
h. s1.reverse();
i. s1.replare , "Computer");
j. String 53=51. substring (1,3);
Q 5 ( 1 0 marks ) : Suppose that 5 1 and 5 2 are

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!