File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes List creating Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "List creating" Watch "List creating" New topic
Author

List creating

Jukka Kuusamo
Greenhorn

Joined: Jan 19, 2010
Posts: 11
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
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16483
    
    2

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?
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 8436

And Welcome to the Ranch!


[Donate a pint, save a life!] [How to ask questions] [Onff-turn it on!]
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

Can you show us:
- the declaration of the EnumMap
- the call to put
- the declaration of the objects you put in there


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
Jukka Kuusamo
Greenhorn

Joined: Jan 19, 2010
Posts: 11
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!
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: List creating
 
Similar Threads
Removing brackets from arraylist printout.
Generic Array Creation Error Message
Display of hashmap values using jstl
casting objects with parameterized types
Pass By Value (again)