endIndex « substring « Java Data Type Q&A





1. substring(startIndex, endIndex) - why index out of range is not thrown?    stackoverflow.com

I came across some substring() method mystery and not sure why it is not throwing out of index error. The string "abcde" has index start from 0 to 4 but substring() method ...