File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Elasticsearch in Action
this week in the
Joined: Jan 19, 2010
Jan 19, 2010 19:03:49
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
and put there array:
The method put(...,ArrayList<String>) in the type EnumMap<...,ArrayList<String>> is not applicable for the arguments (int, ArrayList<String>)
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
Joined: Oct 14, 2005
Jan 19, 2010 20:43:15
Actually I don't understand what you are trying to do. You use an
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?
Joined: Jul 26, 2007
Jan 19, 2010 21:21:04
And Welcome to the Ranch!
How to ask questions
Donate a pint, save a life!
Onff-turn it on!
Joined: Oct 27, 2005
Jan 20, 2010 01:21:48
Can you show us:
- the declaration of the
- the call to put
- the declaration of the objects you put in there
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions
How To Answer Questions
Joined: Jan 19, 2010
Jan 20, 2010 10:34:49
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.
It is sorta covered in the
JavaRanch Style Guide
subject: List creating
Display of hashmap values using jstl
casting objects with parameterized types
Pass By Value (again)
Removing brackets from arraylist printout.
Generic Array Creation Error Message
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015