List和Set转Long数组

Set<User> a = c.getUsers();
Iterator<User> x = a.iterator();
users = new Long[a.size()];
while (x.hasNext()) {
b = x.next();
users[i]=b.getId();
System.out.println(users[i]+"aa");
i++;
}

posted @ 2015-03-27 15:55  王八一瓶子  阅读(1597)  评论(0编辑  收藏  举报