Using Map and Lists. Simple
My prolem is very simple, but i'm beggining with java.
I have 10 key-values: "CUSTOMER_ID" , the others are not important
What is important is that I want to have different values under the same key CUSTOMER_ID
The structure should be like this:
Which structure can I use?
can I use Java Map?
and how to insert this values and how to load it?
Please show me simple code
sounds like a table to me. I think a tree would work. it would prevent redundant data. The tree would have several nodes (keys) then you can add leafs (values) to each node.
If you don't know what and how many "different" values you need to associate to a Customer object you should implement Customer as a class with an inner Hashtable+ArrayList to hold these values. This would require some typecasting, sorting and instanceof - coding though.
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center