1、字符串不变性下面这张图展示了这段代码做了什么12String s = "abcd";s = s.concat("ef");2、equals()方法、hashCode()方法的区别HashCode被设计用来提高性能。equals()方法与hashCode()方法的区别在于:如果两个对象相等(equ...
分类:
编程语言 时间:
2014-06-16 00:02:04
阅读次数:
367
最近在看 高级点的程序员必看的 CLR via C# 书中说解释了Object.Equals() 方法的实现, 其中具体的实现用的是== 运算符!以前就对 == 运算符 的具体实现 产生过疑惑 . 它到底对比的什么?今天刚好手头的东西弄完了,而且还得强制加班中 ! 所以就那今天的加班时间 来认真 ....
分类:
其他好文 时间:
2014-06-15 23:32:50
阅读次数:
269
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-06-15 19:55:39
阅读次数:
191
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 and sum
...
分类:
其他好文 时间:
2014-06-15 19:26:23
阅读次数:
207
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 bin...
分类:
其他好文 时间:
2014-06-15 09:34:35
阅读次数:
226
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 giv...
分类:
其他好文 时间:
2014-06-13 16:09:02
阅读次数:
237
1、字符串不变性下面这张图展示了这段代码做了什么12String s = "abcd";s =
s.concat("ef");2、equals()方法、hashCode()方法的区别HashCode被设计用来提高性能。equals()方法与hashCode()方法的区别在于:如果两个对象相等(equ...
分类:
编程语言 时间:
2014-06-13 14:45:01
阅读次数:
233
什么是equals方法
指示其他某个对象是否与此对象相等,equals方法存在Object类中,我们编写的类继承Object,可以覆盖Object的equals方法来实现我们的逻辑,去判断两个对象是否相等。Object类中的equals方法
一起来看看Object类中的源代码 public...
分类:
其他好文 时间:
2014-06-10 09:52:27
阅读次数:
159
public boolean equals(Object otherObject) {
if(this == otherObject) { // 检测this与otherObject是否引用同一个对象
return true;
}
if(null == otherObject ) { // 检测otherObject是否为空
ret...
分类:
编程语言 时间:
2014-06-08 04:00:26
阅读次数:
299