THE PACKAGE JAVA.LANG
java.lang.Object
20.1
@
, and the unsigned hexadecimal representation of the hashcode of the object.
In other words, this method returns a string equal to the value of:
getClass().getName() + @ + Integer.toHexString(hashCode())
Overridden by
Class
( 20.3),
Boolean
( 20.4),
Character
( 20.5),
Inte
ger
( 20.7),
Long
( 20.8),
Float
( 20.9),
Double
( 20.10),
String
( 20.12),
StringBuffer
( 20.13),
Thread
( 20.20),
ThreadGroup
( 20.21),
Throwable
( 20.22.4), and
Bitset
( 21.2).
20.1.3
public boolean equals(Object obj)
This method indicates whether some other object is equal to this one.
The general contract of
equals
is that it implements an equivalence relation:
It is
reflexive
: for any reference value
x
,
x.equals(x)
should return
true
.
It is
symmetric
: for any 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 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 reference values
x
and
y
, multiple invocations of
x.equals(y)
consistently return
true
or consistently return
false
, provided
no information used by
x
and
y
in
equals
comparisons is modified.
For any non null reference value
x
,
x.equals(null)
should return
false
.
The
equals
method defined by class
Object
implements the most discrimi
nating possible equivalence relation on objects; that is, for any reference values
x
and
y
,
((Object)x).equals(y)
returns
true
if and only if
x
and
y
refer to the
same object.
Overridden by
Boolean
( 20.4),
Character
( 20.5),
Integer
( 20.7),
Long
( 20.8),
Float
( 20.9),
Double
( 20.10),
String
( 20.12), and
Bitset
( 21.2).
20.1.4
public int hashCode()
This method is supported principally for the benefit of hash tables such as those
provided by the Java library class
java.util.Hashtable
( 21.5).
The general contract of
hashCode
is as follows:
Whenever it is invoked on the same object more than once during an execu
tion of a Java application,
hashCode
must consistently return the same
459
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Inexpensive Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Jsp Hosting
Cheap Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved