当前位置: 首页 > news >正文

酒店网站建设趋势百度搜索排名与点击有关吗

酒店网站建设趋势,百度搜索排名与点击有关吗,政务网站建设方案,北京短视频拍摄Map集合的常用方法 方法名称作用V put(Key k,V value)添加元素V remove(K key, V value)根据键值删除对应的值void clear()清除所有键值元素boolean containsKey(Object key)判断集合中是否包含指定的键boolean containsValue(Object value)判断集合中是否包含指定的值boolean …
Map集合的常用方法
方法名称作用
V put(Key k,V value)添加元素
V remove(K key, V value)根据键值删除对应的值
void clear()清除所有键值元素
boolean containsKey(Object key)判断集合中是否包含指定的键
boolean containsValue(Object value)判断集合中是否包含指定的值
boolean isEmpty()判断集合是否为空
size()返回集合中存放元素的个数

示例代码

package com.collection.Demo09;import java.util.HashMap;
import java.util.Map;public class Test01 {public static void main(String[] args) {Map<String, String> hashMap = new HashMap<>();System.out.println("========put========");hashMap.put("mayikt001", "小明");hashMap.put("mayikt002", "xiaojun");hashMap.put("mayikt003", "xiaoli");hashMap.put("mayikt003", "小王"); //键是不允许重复的,这里并不会报错,而是修改K="003"的值为V="mayikt"System.out.println(hashMap);//{mayikt002=xiaojun, mayikt001=小明, mayikt003=小王}//注意:上面遍历的顺序并不是put插入的顺序——∴元素存取是散列无序的System.out.println("========remove========");hashMap.remove("mayikt001"); //返回String类型
//        hashMap.remove("mayikt002","xiaojun");//只有键值对 都 存在才可以删除,返回Boolean类型hashMap.remove("xiaojun"); //没有这个键 ,执行并不报错System.out.println(hashMap);System.out.println("========clean========");
//        hashMap.clear();//清空hashMap集合中所有键值对System.out.println(hashMap);//{}System.out.println("========containsKey========");//判断在 hashMap集合中 是否存在 键值=mayikt002, 返回true/falseSystem.out.println(hashMap.containsKey("mayikt002"));//trueSystem.out.println("========containsValue========");System.out.println(hashMap.containsValue("xiaowang"));//falseSystem.out.println(hashMap.containsValue("小王"));//trueSystem.out.println(hashMap.containsValue("小明"));//falseSystem.out.println("========isEmpty========");System.out.println(hashMap.isEmpty());//falseHashMap<String, String> hashMap1 = new HashMap<>();System.out.println(hashMap1.size());//0 hashMap1中元素的个数HashMap<String, String> hashMap2 = null;System.out.println(hashMap1.isEmpty());//true
//        System.out.println(hashMap2.isEmpty());//报错.NullPointerException}
}

下一篇文章:

http://www.hkea.cn/news/834722/

相关文章:

  • 易云巢做网站公司seo入门到精通
  • 新津网站建设百度ai助手入口
  • 做学校网站什么文案容易上热门
  • 网站开发技术包括郑州网站关键词排名
  • 网站开发预算怎么算百度竞价ocpc
  • 成都锐度设计公司怎么样优化大师怎么提交作业
  • 租用网站服务器东莞市网站建设
  • 馆陶县网站网站运营管理
  • 西双版纳傣族自治州医院seo搜索优化网站推广排名
  • wordpress站点网址小吃培训2000元学6项
  • 郑州网站制作天强科技seo百度发包工具
  • 江阴市住房与建设局网站seo工资多少
  • wordpress image.php南宁百度首页优化
  • 谢家华做网站百度指数与百度搜索量
  • wordpress 安装 ubuntu整站优化代理
  • 做公司网站协议书模板下载百度竞价推广公司
  • 福田蒙派克6座二手值多少钱重庆seo点击工具
  • 有了域名 怎么做网站外贸网站推广方法之一
  • 审美网站长春网站建设路
  • 网站 管理系统域名查询注册信息查询
  • 专业网站设计发展前景推广网站软文
  • 怎么建设seo自己网站网站优化推广教程
  • 最新app开发软件石家庄网站建设seo公司
  • 江苏自助建站系统哪家好推广网站要注意什么
  • 唐河做网站关键字搜索引擎
  • 松江专业做网站公司seo视频教程百度云
  • 淄博品质网站建设竞价推广怎么样
  • 搜狗站群系统资源网站优化排名优化
  • 建设一个网站哪家好网站推广优化的原因
  • 做网站的上海公司有哪些情感链接