码迷,mamicode.com
首页 >  
搜索关键字:hashset hashcode equals    ( 6917个结果
IT忍者神龟之Hibernate联合主键下,主键生成策略
如果数据库中用多个字段而不仅仅是一个字段作为主键,也就是联合主键,这个时候就可以使用hibernate提供的联合主键生成策略。 具体如下: 可以使用一个组件作为一个实体类的标识符。你的组件类必须满足以下要求: 它必须实现 java.io.Serializable 接口 它必须重新实现 equals() 和 hashCode() 方法,始终和组合关键字在数据库中的概念保持...
分类:Web程序   时间:2014-10-29 13:08:18    阅读次数:235
HashMap与HashTable、HashSet与HashMap异同
1、 HashMap与HashTable的区别:(1)HashMap允许将null作为一个entry的key或者value,而Hashtable不允许。当get()方法返回null值时,即可以表示HashMap中没有该键,也可以表示该键所对应的值为null。因此,在HashMap中不能由get()方...
分类:其他好文   时间:2014-10-29 12:25:06    阅读次数:156
关于JAVA的线程问题
实验思路:这个是我写的一个测试线程数量的程序import java.util.Date;import java.util.HashSet;import java.util.Map;import java.util.Set;public class MyThreadTest { public stat...
分类:编程语言   时间:2014-10-28 17:15:55    阅读次数:286
POJ2417 Baby-Step-Gaint-Step 算法
考虑一个问题:A^x%p=B,给定A,B,p,求x的最小非负整数解。 在p是质数的情况下,这个问题比较简单。 A^x=B(mod P) (P is a Prime, A,B Let m = floor(sqrt(P)) Put A^0,A^1,...A^(m-1) into HashSet(You Can Also Use Map in STL),for Example M[A^i]=i....
分类:编程语言   时间:2014-10-28 13:55:30    阅读次数:271
leetcode Path Sum
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Fo...
分类:其他好文   时间:2014-10-28 07:02:27    阅读次数:171
让代码重构渐行渐远系列(3)——string.Equals取代直接比较与非比较
重构背景及原因 最近由于项目组的人员在不断扩充,导致项目中代码风格各异,大有百花齐放甚至怒放之势。考虑到团队的生存与发展,经过众人多次舌战之后,最终决定项目组根据业务分成几个小分队,以加强团队管理与提高效率,同时也能培养阶梯人才。各个小分队为了“统一”代码风格,提高成员的代码能力以便最终能提高项目....
分类:其他好文   时间:2014-10-27 22:30:59    阅读次数:156
[转]null和""以及==与equals的区别
String str1 = null; str引用为空 String str2 = ""; str引用为空串 直接点就是null没有分配内存空间,而""分配了内存空间,因此str1还不是一个实例化的对象,而str2已经实例化。 注意因为null不是对象,""是对象。所以比较的时候必须是 if(str...
分类:其他好文   时间:2014-10-27 19:10:12    阅读次数:139
[leetcode]Path Sum II
问题描述: Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum. For example: Given the below binary tree and sum = 22, 5 /...
分类:其他好文   时间:2014-10-26 14:24:00    阅读次数:224
[leetcode] Path Sum
问题描述: Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. For example: Given the below binary tree...
分类:其他好文   时间:2014-10-26 13:11:29    阅读次数:177
四个集合的初步了解
List apple=new ArrayList;ArrayList向上转型为List。四大集合:List、Set、Queue、Map。其中有LinkedList、HashList、LinkedSet、TreeSet、HashSet、LinkedMap、TreeMap、HashMap;Linked....
分类:其他好文   时间:2014-10-26 00:22:53    阅读次数:232
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!