I have created a class called aptSchedule which, like its name suggests, keeps track of appointments in the form of a schedule. I would like to create a method that looks for and finds the first open appointment. In order to create this method I must first figure out a way to find all appointments. I figure that I will need to create a public variable of sorts, but I am not very familiar with Java and I was curious where and how should I create such a variable? Am I explaining myself well enough?
Thank you,
Evan
You will have to store all the appointments in some sort of collection, let’s go with a simple
List<Appointment>(assuming each appointment is stored in a(n objec of type)Appointment). Then you can have your class like this: