为什么这一行会给我一个 NullPointerException?
List<Comment> commentList = commentDAO.getComments();
getComments() 方法确实返回一个列表,但是当我在 Eclipse 中单步执行代码时,该方法甚至没有被调用。
最佳答案
唯一的可能是commentDAO为空
关于java - NullPointerException 尝试调用具有正确返回类型的方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16258741/