You need to sign in to do that
Don't have an account?
Kellan Scheiber
I have the below class and when I am unable to get my Time [] to assign to by busSchedule variable. I have tried several constructors but am clearly missing something.
public class BusSchedule { public Time [] busSchedule; public void putSchedule(string busLine, Time[] schedule){ Map<String, Time[]> schedule2 = new Map<String, Time[]>(); schedule2.put(busLine, schedule); busSchedule = schedule2.get(busLine); } public Time[] getSchedule(string busLine){ Time[] bSched = new Time[]{}; if (busLine !=null) { bSched = busSchedule; } else { bSched.add(Time.newInstance(8,0,0,0)); bSched.add(Time.newInstance(17,0,0,0)); } return bSched; } }
Kellan Scheiber
I was able to get this corrected I needed to implement a static variable to hold the value across the class.