Map map = new HashMap();
//map.put(key, value);
map.put("nama", "Coutinho");
map.put("negara", "Brazil");
System.out.println(map);
System.out.println(map.get("nama"));
//map.put(key, value);
map.put("nama", "Coutinho");
map.put("negara", "Brazil");
System.out.println(map);
System.out.println(map.get("nama"));
Demikian contoh penggunaan dari Map pada JAVA, semoga bermanfaat.
GBU.
Related Posts
0 comments:
Posting Komentar