I cleared the SCJP exam today but I have seen two to three questions that address that concept. I realized I don't know whether the program exits or continue execution after the finally block. I guessed that the program will exit gracefully.
The other confusing topic was about the index used in the String.substring(), replace(), delete() methods. I thought it was absolutely ridiculous for JavaSE team to define the method with a zero-based starting indicee and a 1-based ending indicee (if this is true, please do correct me if wrong). During the exam, I was doing this index counting question and I realize I don't know how to count index of a simple "123456789" string anymore!
I feel like an idiot doing this index counting. Why cann't Sun make everything 0-based? Anyway, this is simply dumb. I am sorry if I offend anyone but I have to say this again, because it is really, really dumb to make people work two different index-base in a single method and expect them to not be confused.
Clear the exam but still mad because I thought I would have done better.
Tim-Ting Chang wrote:
I thought it was absolutely ridiculous for JavaSE team to define the method with a zero-based starting indicee and a 1-based ending indicee (if this is true, please do correct me if wrong).
Unfortunatelly, You are wrong. With 0-based first argument and 1-based the second one - you can simply calculate a substring's length: end - start