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("############################################");
            
            
            
            
        }
    
    }
  • 相关阅读:
    Leetcode 242.有效的字母异位词 By Python
    Leetcode 344.反转字符串 By Python
    Leetcode 217.存在重复元素 By Python
    js 动态加载select触发事件
    MUI 里js动态添加数字输入框后,增加、减少按钮无效
    【 jquery 】常用
    MySql 常用语句
    CSS 选择器 知识点
    HTML 符号实体
    log4net 配置
  • 原文地址:https://www.cnblogs.com/JimLy-BUG/p/5026672.html
Copyright © 2011-2022 走看看