第一次查看jdk源码,千里之行,始于足下。
/**
* Returns <tt>true</tt> if this list contains no elements.
*
* @return <tt>true</tt> if this list contains no elements
*/
public boolean isEmpty() {
return size == 0;
}
上面是ArrayList的isEmpty方法。
从这里开始。