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

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -