空指针报错
Exception in thread "main" java.lang.NullPointerException
at stu_select_class.SetTest.testSetContains(SetTest.java:125)
at stu_select_class.SetTest.main(SetTest.java:138)
代码和老师一样
125行是
System.out.println("备选课程中是否包含课程:"+course2.name+","
+student.courses.contains(course2));(黑色加粗部分)
138行是
st.testSetContains();(调用了testSetContains方法