Hi guys 'n' gals

Just need some advice -

I am using a sorted map to store info that I read line by line from a text file.

example of info:
id product price
1 option_1 23
2 option_1 23
3 option_1 23
2 option_2 24
3 option_2 24
3 option_3 12

My question is: Will I be able to use the id's as keys? That would mean that there would be more than 1 key with the value "3".

Is this allowed? If not, what should I use instead?

Hi P00dle,

A map cannot contain duplicate keys.

If you have duplicate elements you could use a list.

Hi Andre,

I've closed this thread, and opened another, where I have worked around this problem. Thank you for the advice, though.

Hope you will check out the new thread :
How hould I use this SortedMap?
(I just realized there is a speeling error:|)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.