The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

gpar (5) [Avatar] Offline
#1
Hi Mala,

I may be bit silly in asking this, In the chapter 8 Full mock exam, question 44 says

"When the multiple methods are chained on a single code statement, the methods execute from left to right" then, when the same question is modified like this,

public class SimpleStringTest {
public static void main(String args[])
{
String ints="123456789";
System.out.println(ints.concat("0").substring(ints.indexOf("2"),ints.indexOf("0")));
}

why is it the same Exception? i.e StringIndexOutOfBondsException?

Can you please clarify this as soon as possible, as I am going to right the exam next month.