开发者

how to get values of my poll object?

I have my HashMap,

private final HashMap<Integer, Poll> pollmap = new HashMa开发者_如何学编程p<Integer, Poll>();

and my constructor is:

Poll(int id, String pollName, String question, String pollAnswerOptions[], boolean active)

How do I get the extract the Poll values such as pollname, question, etc FROM the pollmap hashmap?


Integer i = ... 
Poll poll = pollmap.get(i);

Then use whatever methods on the Poll object available to you to extract the values, e.g.,

poll.getId();
poll.getPollName();

and so on.


Get the Poll objects, and then on each object the values, like this:

pollmap.get(key).getPollName 

etc.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜