0

How can i store the whole data in one collection?

Members interested in the sane sport are divided into groups i am asked to store the whole data all grouos of all sports in one collection i have created class grouo and class sports and i hae added an arraylist of grouos in class sports but i am stuck their

4th May 2021, 1:48 PM
Mark G. Ghrayeb
Mark G. Ghrayeb - avatar
2 Antworten
0
show your code plzsssssssss.
4th May 2021, 2:07 PM
VuxxLong
VuxxLong - avatar
0
Mark G. Ghrayeb You can make a collection of HashMap where sport_id maybe key and groups maybe value. Also there maybe different groups with many people so you may create HashMap of HashMap where Inner HashMap key will be group_id and value will be members_list and Outer HashMap key will be sport_id. So it maybe look like this: HashMap<Long, HashMap<Long, ArrayList<Group> hm = null; Can you show your code? See my this example: https://code.sololearn.com/c7A5A19A13A2/?ref=app
4th May 2021, 6:11 PM
A͢J
A͢J - avatar