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
2 ответов
0
show your code plzsssssssss.
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