public static void main(String args[]) { // declare all the object String username = null, password = null; Staff inputStaff = null; ArrayList<Staff> getList = null; boolean staffStatus = false; DatabaseStaff dbStaff = new DatabaseStaff(); // scan the staff username and password System.out.println("------------------------"); System.out.print("Username: "******"Password: "******"------------------------"); inputStaff = new Staff(username, password); // processing database System.out.println("Check Database"); System.out.println("process.....\n"); getList = dbStaff.readFromDatabase("staff.dat"); for (int i = 0; i < getList.size(); i++) { Staff printStaff = (Staff) getList.get(i); if (printStaff.EqualsStaff(inputStaff)) { staffStatus = true; break; } } if (staffStatus) { System.out.println("welcome Staff\n"); viewCinemaFromDatabase(); } else { System.out.println("Sorry your username and password is not match with our database"); } }