sergAccount

Untitled

Feb 14th, 2021
577
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package com.mycompany.ja11;
  7.  
  8. import java.util.HashMap;
  9. import java.util.Map;
  10. import java.util.Set;
  11.  
  12. /**
  13.  *
  14.  * @author Admin
  15.  */
  16. public class Main4 {
  17.    
  18.     public static void main(String[] args) {
  19.         // Map        
  20.         Map<String, String> m = new HashMap<>();
  21.         // помещаем объект по ключу в Map
  22.         m.put("KEY", "VALUE"); // KEY VALUE
  23.        
  24.         Map<Integer, String> m1= new HashMap<>();
  25.         m1.put(10, "value");
  26.         //m1.put("STRRRR", "value");
  27.        
  28.         int r = 11;
  29.         m1.put(r, "value");
  30.        
  31.         Set<String> set = m.keySet();
  32.         for(String key: set){
  33.             System.out.println("key=" + key);
  34.         }                
  35.     }
  36. }
  37.  
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×