zoukankan      html  css  js  c++  java
  • [Training Video

    Hashset:

    HashSet set = new HashSet()
    set.add("India")
    set.add("USA")
    set.add("China")
    log.info "Set size is : " + set.size()
    
    set.add("China")
    log.info "Set size is : " + set.size()
    
    Iterator iter = set.iterator();
    log.info "If has next : " +iter.hasNext()
    log.info iter.next()
    while(iter.hasNext()){
    	log.info iter.next()
    }
    

     Result :

    Tue Jun 16 15:02:49 CST 2015:INFO:Set size is : 3
    Tue Jun 16 15:02:49 CST 2015:INFO:Set size is : 3
    Tue Jun 16 15:02:49 CST 2015:INFO:If has next : true
    Tue Jun 16 15:02:49 CST 2015:INFO:USA
    Tue Jun 16 15:02:49 CST 2015:INFO:China
    Tue Jun 16 15:02:49 CST 2015:INFO:India

    Hashtable :

    Hashtable table = new Hashtable()
    table.put("name","Henry")
    table.put("country","Russia")
    table.put("telephone","13658988546")
    table.put("email","henry.wasley@gmail.com")
    
    log.info "Size of table is " + table.size()
    log.info "Name is " + table.get("name")
    log.info "Country is " + table.get("country") 
    

     Result :

    Tue Jun 16 15:06:55 CST 2015:INFO:Size of table is 4
    Tue Jun 16 15:06:55 CST 2015:INFO:Name is Henry
    Tue Jun 16 15:06:55 CST 2015:INFO:Country is Russia

  • 相关阅读:
    mysql 时间戳 转 时间
    VSCode搭建VUE 开发环境
    虚拟通信
    JavaScript 获取客户端计算机硬件及系统信息
    Thinkphp关联模型BELONGS_TO
    docker部署rancher踩坑篇
    青龙面板 脚本 依赖库下载安装
    Linux 随记
    Tekton DAG代码
    手写Spring valar
  • 原文地址:https://www.cnblogs.com/MasterMonkInTemple/p/4580857.html
Copyright © 2011-2022 走看看