ArrayList<String> list = new ArrayList<>();
           list.add("b");
           list.add("a");
           list.add("d");
           list.forEach(item -> System.out.print(item));
           
           
           HashMap<String, String> map = new HashMap<>();
           map.put("1", "1");
           map.put("2", "2");
           map.put("3", "3");
           map.forEach((String key, String value) -> {
               System.out.println("key-->>" + key + "value--->>" + value);
           });

 

相关文章:

  • 2022-12-23
  • 2021-04-29
  • 2021-08-30
  • 2022-12-23
  • 2021-10-09
  • 2022-12-23
  • 2022-12-23
  • 2021-11-27
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-06
  • 2022-12-23
  • 2022-12-23
  • 2021-06-22
  • 2022-01-15
相关资源
相似解决方案