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("############################################");
            
            
            
            
        }
    
    }
  • 相关阅读:
    GoF23种设计模式之己见
    全面阐述某系统设计所实现的质量属性战术
    对XX系统的可用性和易用性改良
    《淘宝网》的质量属性描述
    读《架构漫谈》之后
    软件架构之再理解
    《架构之美》阅读笔记06
    《架构之美》阅读笔记05
    《架构之美》阅读笔记04
    《架构之美》阅读笔记03
  • 原文地址:https://www.cnblogs.com/JimLy-BUG/p/5026672.html
Copyright © 2011-2022 走看看