我有我的 HashMap,
private final HashMap<Integer, Poll> pollmap = new HashMap<Integer, Poll>();
我的构造函数是:
Poll(int id, String pollName, String question, String pollAnswerOptions[], boolean active)
如何从 pollmap HashMap 中提取 Poll 值,例如 pollname、问题等?
最佳答案
Integer i = ...
Poll poll = pollmap.get(i);
然后使用 Poll
对象上可用的任何方法来提取值,例如,
poll.getId();
poll.getPollName();
等等。
关于java - 如何获取我的 poll 对象的值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6479547/