Java集合框架-16.Map特点、常年API、三种遍历方式

1、双列集合的特点

image

image

 2、常见API

image

 代码测试:put()

image

  代码测试:remove()

image

   代码测试:clear()

image

    代码测试:containsKey() containsValue()

image

代码测试:isEmpty()

 

image

 代码测试:size()

image

  3、Map遍历方式1 (键找值)

代码测试

image

 4、Map遍历方式2 (键值对)

 代码测试

image

 5、Map遍历方式3 (lambda表达式)

image

 代码测试:

image

image

 

posted @ 2025-09-02 14:20  少年阿川  阅读(12)  评论(0)    收藏  举报