List 的size是0时,get(0) 会报IndexOutOfBoundsException

LIist list = new ArrayList();

list.get(0); // IndexOutOfBoundsException

这个时候的数组没有index,长度是0

原文地址:https://www.cnblogs.com/shouwangzhe-/p/3936835.html