zoukankan      html  css  js  c++  java
  • java之hashCode

    package com.simope.myTest;
    
    import java.util.HashMap;
    import java.util.Map;
    
    public class Test20151022 {
        
        public static void main(String[] args) {
            
            int count = 0;
            
            String str = "hello world";
            String myStr = "hello world";
            
            Map<String, Object> map = new HashMap<String, Object>();
            Map<String, Object> myMap = new HashMap<String, Object>();
            
            map.put("name", "zhangsan");
            map.put("age", "12");
            map.put("sex", "man");
            
            myMap.put("name", "zhangsan");
            myMap.put("age", "13");
            myMap.put("sex", "women");
            
            
            System.out.println((++count) + ": " + str.hashCode());
            
            System.out.println((++count) + ": " + myStr.hashCode());
            
            System.out.println("############################################");
            
            System.out.println((++count) + ": " + map.get("name").hashCode());
            
            System.out.println((++count) + ": " + map.get("age").hashCode());
            
            System.out.println((++count) + ": " + map.get("sex").hashCode());
            
            System.out.println("############################################");
            
            System.out.println((++count) + ": " + myMap.get("name").hashCode());
            
            System.out.println((++count) + ": " + myMap.get("age").hashCode());
            
            System.out.println((++count) + ": " + myMap.get("sex").hashCode());
            
            System.out.println("############################################");
        
            System.out.println((++count) + ": " + str.getClass());
            
            System.out.println((++count) + ": " + myMap.getClass());
            
            System.out.println("############################################");
            
            
            
            
        }
    
    }
  • 相关阅读:
    时间,关机重启及网络常识
    bash xshell 特性
    Http介绍
    rsync 守护进程模式小记
    定时任务+邮件发送 小记
    4.iptables的匹配条件(一)
    3.iptables规则管理
    2.iptables规则查询
    1.iptables概念
    4.LVS实验构建
  • 原文地址:https://www.cnblogs.com/JimLy-BUG/p/5026672.html
Copyright © 2011-2022 走看看