一.首先明确一点:equals()方法和hashcode()方法是Object类里的方法。
查看源码可以知道,在Object类中equals(obj)方法直接返回的是 this ==
obj的值。对于引用变量来说,这个式子判断的是变量中存储的内存地址是否一致。而hashcode()方法的出现,目的....
分类:
其他好文 时间:
2014-06-07 05:35:47
阅读次数:
241
http://blogs.msdn.com/b/borisj/archive/2006/09/28/769708.aspxI apologize for the
long delay for this section (although I suppose my average posting fr...
分类:
编程语言 时间:
2014-05-30 13:08:38
阅读次数:
362
function getStyle(ojb,attr){ if(obj.currentStyle){
return obj.currentStyle[attr]; } else{ return getComputedSt...
分类:
Web程序 时间:
2014-05-28 17:03:10
阅读次数:
269
function getStyle(ojb,attr){ if(obj.currentStyle){
return obj.currentStyle[attr]; } else{ return getComputedSt...
分类:
Web程序 时间:
2014-05-28 16:19:05
阅读次数:
238
Have we missed some critical information from
this article? Are you a company, organisation or research group operating in
this region and feel you wa...
分类:
其他好文 时间:
2014-05-28 04:06:31
阅读次数:
337
object对象中的 public boolean equals(Object
obj),对于任何非空引用值 x 和 y,当且仅当 x 和 y 引用同一个对象时,此方法才返回 true; 注意:当此方法被重写时,通常有必要重写
hashCode 方法,以维护 hashCode 方法的常规协定,该协定...
分类:
其他好文 时间:
2014-05-28 00:40:59
阅读次数:
211
这篇文章纯粹是为了保存这些方法,供以后翻阅,其实一直保存在 evernote
里面,但觉得还是放到对的地方会好点。现在收录的很少,希望以后会慢慢增多。数组扩展contains,remove 扩展 1 function
ArrayContains(array, obj) { 2 for (va...
分类:
编程语言 时间:
2014-05-27 16:49:27
阅读次数:
262
//this 指的是调用 当前方法 (函数) 的那个对象function fn1(){ this;
}//fn1(); this => window//obj.onclick=fn1; this=>obj//obj.onc...
分类:
其他好文 时间:
2014-05-26 20:16:04
阅读次数:
245
Java这么多高灵活性,很多都是利用反射来实现的,所谓的反射是指,编译期间完全未知的classes,运行时,对任一个类(根据类名-字符串),能够知道这个类的所有属性和方法;对于任一个对象,都能够调用它的任意一个方法和属性。
简而言之,Java反射机制主要提供了以下功能:
Ø 在运行时判断任意一个对象所属的类;obj.getClass()
Ø 在运行时构造任意一个类的...
分类:
编程语言 时间:
2014-05-25 21:09:39
阅读次数:
196
jQuery 获取兄弟元素的几种方法。获取指定元素的兄弟元素时,可以使用adjacent
sibling combinator (+),其中+的两侧内容都是selector expression. 如果要获取下例中所有的 h1的直接兄弟元素h2
Main title Section title S....
分类:
Web程序 时间:
2014-05-25 19:13:38
阅读次数:
374