JAVA save several DATE into a LIST using a custom Datatype -
i want save several periods of time, that:
public class periodoftime { date from; date to; }
into list, looks that
list <periodoftime> periodsoftime = new list<periodoftime>()
right now.
how can store !for example!
date s = new date();
in list?
my thoughts were, can done
periodsoftime.add(s,s)
but keeps on telling me
the method add(int, periodoftime) in type list not applicable arguments (date, date)
can guide me?
probably totally blind right now....
you may want make getters , setters:)
try:
periodoftime period = new period(); period.from = date; period.to = another_date;
and add example arraylist:
periodsoftime.add(period);
it help.
Comments
Post a Comment