📜  hashmap按键获取值java代码示例

📅  最后修改于: 2022-03-11 14:52:38.833000             🧑  作者: Mango

代码示例2
import java.util.HashMap;
//Within a class
//You can do new HashMap();, but you don't need to
HashMap examplehashmap=new HashMap<>();
{
//put in values
 examplehashmap.put(5, "example");
};
//get value
examplehashmap.get(5);
//returns "example"