To explain further, I have a class named Website which contains the method checkout() which is as follows:
public void checkout(Member member, Holiday holiday)
System.out.println("Transaction successfully complete.");
System.out.println("Member " + member.getMembershipNumber() + " has paid for " + holiday.getRefNo() + ".");
member.setLoginStatus(false);
I want to call this checkout() method from my Member class, specifically through the method payForHoliday()
The code for this is currently:
public void payForHoliday(Website website)
website.checkout(this, holiday);
It works BUT I am given an error in the terminal window which reads:
java.lang.NullPointerException
at Website.checkout(Website.java:79)
at Member.payForHoliday(Member.java:108)
Can anyone give me any help? Thanks.