易截截图软件、单文件、免安装、纯绿色、仅160KB

Java equals

boolean java.lang.Object.equals(Object obj)
Indicates whether some other
object is "equal to" this one.
The equals method implements an
equivalence relation on non-null object references:
It is reflexive: for
any non-null reference value x, x.equals(x) should return true.
It is
symmetric: for any non-null reference values x and y, x.equals(y) should return
true if and only if y.equals(x) returns true.
It is transitive: for any
non-null reference values x, y, and z, if x.equals(y) returns true and
y.equals(z) returns true, then x.equals(z) should return true.
It is
consistent: for any non-null reference values x and y, multiple invocations of
x.equals(y) consistently return true or consistently return false, provided no
information used in equals comparisons on the objects is modified.
For any
non-null reference value x, x.equals(null) should return false.
The equals
method for class Object implements the most discriminating possible equivalence
relation on objects; that is, for any non-null reference values x and y, this
method returns true if and only if x and y refer to the same object (x == y has
the value true).
Note that it is generally
necessary to override the hashCode method whenever this method is overridden, so
as to maintain the general contract for the hashCode method, which states that
equal objects must have equal hash codes
.
See
Also:
hashCode()
java.util.Hashtable
Parameters:
obj the
reference object with which to compare.
Returns:
true if this object is
the same as the obj argument; false otherwise.


相关文档:

Java理论与实践: 描绘线程安全性

Java 理论与实践: 描绘线程安全性
2007-12-15 00:10
——线程安全不是一个非真即假的命题
Brian Goetz (brian@quiotix.com), 首席顾问, Quiotix Corp
2003 年 11 月 15 日
7月份我们的并发专家 Brian Goetz 将 Hashtable 和 Vector 类描述为“有条件线程安全的”。一个类难道不是线程安全就是线程 ......

Java Web基础:第二十讲 Ajax概述

本文内容摘自:《Java Web开发教程——入门与提高篇(JSP+Servlet)》
AJAX是Asynchronous JavaScript and XML的缩写,涉及JavaScript脚本、XHTML和CSS、DOM、XML和XSTL等技术。
l         XHTML与CSS实现数据信息的统一化和标准化显示;
l    & ......

Java与Json的使用方法介绍

转自:
JSON 即 JavaScript Object Natation,它是一种轻量级的数据交换格式,非常适合于服务器与 JavaScript 的交互。本文将快速讲解 JSON 格式,并通过代码示例演示如何分别在客户端和服务器端进行 JSON 格式数据的处理。
  Json必需的包
  commons-httpclient-3.1.jar
  commons-lang-2.4.jar
  commons-l ......

java的cp参数使用


java -cp .;c:\dir1\lib.jar Test
-cp 和 -classpath 一样,是指定类运行所依赖其他类的路径,通常是类库,jar包之类,需要全路径到jar包,window上分号“;”
分隔,linux上是分号“:”分隔。不支持通配符,需要列出所有jar包,用一点“.”代表当前路径。
虽然现在都有eclipse之类的IDE ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号