Question: Given the following code, answer the questions: int value 0; StringBuilder build = new StringBuilder(); do { build.append(value++); } while (value++ < 10); System.out.println

image

Given the following code, answer the questions: int value 0; StringBuilder build = new StringBuilder(); do { build.append(value++); } while (value++ < 10); System.out.println (build.toString()); // print 1 String hello = "What's---the---motto---with-you?"; while(hello.contains("--")) { } hello = hello.replaceFirst ("--", "-"); System.out.println("replacing: " + hello); System.out.println(hello); // print 2 The value printed at "//print 2" The line printed at "//print 1" The number of times the do while loop is executed the number of times the while loop is executed > > > >

Step by Step Solution

3.44 Rating (160 Votes )

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!