Page 685 - AP Computer Science A, 7th edition
P. 685

24. (E) Segment I will throw a NullPointerException when s.equals... is invoked, because s is a null reference. Segment III looks suspect, but when the startIndex parameter of the substring method equals s.length(), the value returned is the empty string. If, however, startIndex > s.length(), a StringIndexOutOfBoundsException is thrown.


































































































   683   684   685   686   687