首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

List isEmpty()跟size()==0 有什么区别

2012-11-05 
List isEmpty()和size()0 有什么区别没有区别,isEmpty()方法也是判断size是否为0./*** Tests if this li

List isEmpty()和size()==0 有什么区别
没有区别,isEmpty()方法也是判断size是否为0.

  /**
  * Tests if this list has no elements.
  *
  * @return <tt>true</tt> if this list has no elements;
  * <tt>false</tt> otherwise.
  */
  public boolean isEmpty() {
return size == 0;
  }

热点排行