码迷,mamicode.com
首页 >  
搜索关键字:hashset hashcode equals    ( 6917个结果
生成订单号
高并发下怎么防止订单号重复...
分类:其他好文   时间:2014-08-04 21:38:48    阅读次数:302
Java杂谈之String----"=="与equals的区别
在程序代码的编写中,经常涉及到两个字符串的比较 这个时候一般困惑我们的是"=="和equals方法的取舍问题,实际上,只要明白了这两者 比较的区别,我们就能够正确的选择出到底采用哪种方式进行字符串的比较了 首先我们定义两个字符串 String s1 = "hello"; String s2 = new String("hello"); 这两个都建立了"hello"的字符串,但到...
分类:编程语言   时间:2014-08-02 13:00:13    阅读次数:233
两个对象值相同(x.equals(y)==true),但却可有不同的hash code,这句话对不对
equals方法对比的是元素的值,可以hashcode不同, 但是如果我们override了自己的equals方法同时也应该重载hashcode方法。假设有obj1和obj2相等, 这时候obj1作为key放入map后,用obj2作为key来获取obj1存入的对象...
分类:其他好文   时间:2014-08-02 10:09:23    阅读次数:170
爪哇国新游记之二十五----图及其遍历查找
代码:import java.util.ArrayList;import java.util.Collections;import java.util.HashSet;import java.util.LinkedHashMap;import java.util.List;import java.u...
分类:其他好文   时间:2014-08-01 19:21:32    阅读次数:291
[leetcode]Path Sum
Path SumGiven 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 give...
分类:其他好文   时间:2014-07-31 23:18:10    阅读次数:227
[leetcode]Path Sum II
Path Sum IIGiven 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 tr...
分类:其他好文   时间:2014-07-31 23:17:10    阅读次数:175
字符串操作
1比较字符串C#中最常见的比较字符串的方法有Compare、CompareTo和Equals方法等,这些方法都归属于String类。Compare方法Compare方法用来比较两个字符串是否相等。它有很多个重载方法,其中最常用的两种重载格式如下。intCompare(stringstrA,strin...
分类:其他好文   时间:2014-07-31 12:40:36    阅读次数:263
重置输入区域控件的公用方法
private void InputClear(Control EditArea) { foreach (Control Ctrl in EditArea.Controls) { if (Ctrl.GetType().Equals(typeof(TextBox))) { Ctrl.Text = "....
分类:其他好文   时间:2014-07-31 09:45:16    阅读次数:164
Path Sum II leetcode java
题目: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 ....
分类:编程语言   时间:2014-07-31 05:22:15    阅读次数:287
Path Sum leetcode java
题目: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 su....
分类:编程语言   时间:2014-07-31 05:21:25    阅读次数:214
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!