• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

List creating

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello greenhorns

Well I'm really not getting this one, and I am sorry that I do not understand objects very well yet.

I want to create List or Map or what you'd recommend, that I will return
I should be able to store there enum and array

I have been trying to use List and Map and everything.

I tried to use EnumMap and put there array:

I seem to be getting always problem like this when I try to put or add objects to objects.

I hope you understand what I'm trying to do
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually I don't understand what you are trying to do. You use an EnumMap when the keys of the map are going to be an Enum type. But then you write code which tries to use an int as a key. That isn't an Enum. So why did you do that?
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And Welcome to the Ranch!
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you show us:
- the declaration of the EnumMap
- the call to put
- the declaration of the objects you put in there
 
Jukka Kuusamo
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's weird but I got it all after I did read Paul Clapham's comment (yesterday nothing seemed to work).

Created map where I have array and enum, it seems to work very well.

Thanks!
 
reply
    Bookmark Topic Watch Topic
  • New Topic