Package java.lang
Class Object
- java.lang.Object
-
public class Object
ClassObject
is the root of the Java Card platform class hierarchy. Every class hasObject
as a superclass. All objects, including arrays, implement the methods of this class.This Java Card platform class's functionality is a strict subset of the definition in the JavaTM Platform Standard Edition (Java SETM) API Specification.
-
-
Constructor Summary
Constructors Constructor Description Object()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
Compares two Objects for equality.
-
-
-
Method Detail
-
equals
public boolean equals(Object obj)
Compares two Objects for equality.The
equals
method implements an equivalence relation:- It is reflexive: for any reference value
x
,x.equals(x)
should returntrue
. - It is symmetric: for any reference values
x
andy
,x.equals(y)
should returntrue
if and only ify.equals(x)
returnstrue
. - It is transitive: for any reference values
x
,y
, andz
, ifx.equals(y)
returnstrue
andy.equals(z)
returnstrue
, thenx.equals(z)
should returntrue
. - It is consistent: for any reference values
x
andy
, multiple invocations ofx.equals(y)
consistently returntrue
or consistently returnfalse
. - For any reference value
x
,x.equals(null)
should returnfalse
.
The
equals
method for classObject
implements the most discriminating possible equivalence relation on objects; that is, for any reference valuesx
andy
, this method returnstrue
if and only ifx
andy
refer to the same object (x==y
has the valuetrue
).- Parameters:
obj
- the reference object with which to compare.- Returns:
true
if this object is the same as the obj argument;false
otherwise.
- It is reflexive: for any reference value
-
-