I am wondering how I should be using java Calendar objects in order to use them properly (use of this class is mandatory for my assignment so while I'd love to use some of the better options - they aren't options).
I've read the documentation here: https://docs.oracle.com/javase/7/docs/api/java/util/Calendar.html#:~:text=A%20Calendar%20object%20can%20produce,as%20well%20as%20their%20meaning.
And I still don't understand how to use a calendar object correctly.
I need to represent arrival and departure times for several train stations. Should I use a separate Calendar object for each arrival time and departure time separately? Can I include both in the same object?
What does a single Calendar object represent? Is it a single point in time (ie Year, Month, Day, Hour, Minute)? Right now I'm using separate objects for each station's arrival and departure times. That means I have a large number of Calendar objects. Am I using them correctly?
My code snipet is:
Calendar TimeArrival = Calendar.getInstance();
Calendar TimeDeparture = Calendar.getInstance();
TimeArrival.set (2020,8,20,00,01);
TimeDeparture.set(2020,8,20,20,30);