当前位置: 代码迷 >> J2SE >> 抛出错误输出list中的内容
  详细解决方案

抛出错误输出list中的内容

热度:1429   发布时间:2013-02-25 00:00:00.0
抛出异常输出list中的内容
List<Date> dates = new ArrayList<Date>()
最后如果dates不为空,就抛出异常输出日期
如果要这样写该怎么写
throw new Exception("日期为"+);

------解决方案--------------------------------------------------------
if (!dates.isEmpty()) {
try {
throw new Exception("日期为"+);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
探讨
List<Date> dates = new ArrayList<Date>()
最后如果dates不为空,就抛出异常输出日期
如果要这样写该怎么写
throw new Exception("日期为"+);
  相关解决方案