Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package com.mycompany.ja11;
- import java.util.HashMap;
- import java.util.Map;
- import java.util.Set;
- /**
- *
- * @author Admin
- */
- public class Main4 {
- public static void main(String[] args) {
- // Map
- Map<String, String> m = new HashMap<>();
- // помещаем объект по ключу в Map
- m.put("KEY", "VALUE"); // KEY VALUE
- Map<Integer, String> m1= new HashMap<>();
- m1.put(10, "value");
- //m1.put("STRRRR", "value");
- int r = 11;
- m1.put(r, "value");
- Set<String> set = m.keySet();
- for(String key: set){
- System.out.println("key=" + key);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement