hi everyone/anyone
I am currently doing an attendance student register. now start to build it. the program goes somethings like this, the program suppose to allow the lecturer to mark student either absent or present, and if there is a holidays in between the day when there is a class, it can allow the lecture to plan a make up class , i tried to implement an if and else statement but ran into a runtime error on line. can u tell me what is the cause of the error and how it can be fixed. here is the codes that I have used. it isnt much because I have now started.
public class AttendanceRecordSystem extends javax.swing.JFrame {
/**
* Creates new form AttendanceRecordSystem
*/
public AttendanceRecordSystem() {
initComponents();
ArrayList <AttendanceRecordSystem> list = new ArrayList<>();
String classday=null ;
String makeup_class = null, plan;
if(classday.contains("holidays")){
System.out.println("plan"+ makeup_class);
}
}
here is the output. the runtime error I am speaking about
[code]Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at AttendanceRecordSystem.AttendanceRecordSystem.<init>(AttendanceRecordSystem.java:27)
at AttendanceRecordSystem.AttendanceRecordSystem$4.run(AttendanceRecordSystem.java:190)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:745)
at java.awt.EventQueue.access$300(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:706)
at java.awt.EventQueue$3.run(EventQueue.java:704)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:715)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

