记一次 NullPointerException

for each 语法要注意空指针

1 List<String> list = null; 
2 for (String e : list) { // Exception in thread "main" java.lang.NullPointerException
3 }

 

posted @ 2019-07-16 12:33  渣渣伟  阅读(199)  评论(0编辑  收藏  举报
--->