I want to create a table such that one key store more than one value against it. Such that I can calculate the number of values against a particular key. I want to create a calendar kind of thing, for each date some number of tasks numbers will be there. Later I can calculate number of tasks against one particular date. I am unable to use TreeMap<Integer,ArrayList<Integer>>, as i can only insert list against integer but i need to add one integer value against key at a time. If I use TreeMap<Integer,Integer>, then after inserting one value against 1 key value, when I insert another value for the same key, the previous value is replaced.
I have a function where I have to validate the key and then for that key I will insert one value. i.e one value can be inserted at a time.
Please refer the image Please provide some solution.
