But it's not 3, right? It's "multiple"? So how do you want to store these "multiple" array lists? You can't start programming until you decide what your code is supposed to do.
Jay Vaghela
Greenhorn
Joined: Feb 15, 2006
Posts: 22
posted
0
The number of JoiningDate is fixed to 3, (I gave it just an example, but the number of multiple arraylist is fixed to 3)
So I will store them in new ArrayList
Jay Vaghela
Greenhorn
Joined: Feb 15, 2006
Posts: 22
posted
0
I want to know what condition I should put inside the loop
Also, I have override the equal method based on the joiningDate
Jay Vaghela
Greenhorn
Joined: Feb 15, 2006
Posts: 22
posted
0
Thanks Paul,
Ok, So, instead of joiningDate just consider it this way, if a person allowed to marry only 3 times in a life then his marriage date would be maximum 3.
firstDate is an ArrayList and form.getJoiningDate is a type of Date.
I can use .contains() method but not sure the exact way.
because how to add the first element in firstDate ArrayList?
Garrett Rowe
Ranch Hand
Joined: Jan 17, 2006
Posts: 1295
posted
0
How about something like:
It might be more flexible if requirements change in the future.
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peter
Jay Vaghela
Greenhorn
Joined: Feb 15, 2006
Posts: 22
posted
0
Sorry, but not getting what you mean to say.
Garrett Rowe
Ranch Hand
Joined: Jan 17, 2006
Posts: 1295
posted
0
The groupByDate() method takes a List<FormBean> and returns a Map<Date, List<FormBean>>, you can use this data structure as-is or optionally transform it into a List<List<FormBean>> where every element in each sub-list has the same Date.