This question refers to the following declaration: String line = "Some more silly stuff on strings!"; //the words are separated by a single space What string will str refer to after execution of the following? int x = line.indexOf("m"); String str = line.substring(10, 15) + line.substring(25, 25 + x); (A) "sillyst" (B) "sillystr" (C) "silly st" (D) "silly str" (E) "sillystrin"

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter7: Characters, Strings, And The Stringbuilder
Section: Chapter Questions
Problem 5PE
icon
Related questions
Question
This question refers to the following declaration:
String line = "Some more silly stuff on strings!";
//the words are separated by a single space
What string will str refer to after execution of the following?
int x =
line.indexOf("m");
String str = line.substring(10, 15) + line.substring(25, 25 + x);
(A) "sillyst"
(B) "sillystr"
(C) "silly st"
(D) "silly str"
(E) "sillystrin"
Transcribed Image Text:This question refers to the following declaration: String line = "Some more silly stuff on strings!"; //the words are separated by a single space What string will str refer to after execution of the following? int x = line.indexOf("m"); String str = line.substring(10, 15) + line.substring(25, 25 + x); (A) "sillyst" (B) "sillystr" (C) "silly st" (D) "silly str" (E) "sillystrin"
Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
Program on Numbers
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT