---
title: "遍历HashMap"
author: "hellsing42"
date: "2007-09-28T14:28:05Z"
tags: []
slug: "hashmap"
draft: false
lastmod: "2007-09-28T14:28:05Z"
id: 127907
url: "https://hellsing42.iteye.com/blog/127907"
---

HashMap staff = new HashMap();
Set entries = staff.entrySet();
Iterator iter = entries.iterator();
while(iter.hasNext())
{
Map.Entry entry = (Map.Entry)iter.next();
Object key = entry.getKey();得么关键字
Object value = entry.getValue();得到值
}