Package java.lang
Class Object
- java.lang.Object
-
public class ObjectClassObjectis the root of the Java Card platform class hierarchy. Every class hasObjectas 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 booleanequals(Object obj)Compares two Objects for equality.
-
-
-
Method Detail
-
equals
public boolean equals(Object obj)
Compares two Objects for equality.The
equalsmethod implements an equivalence relation:- It is reflexive: for any reference value
x,x.equals(x)should returntrue. - It is symmetric: for any reference values
xandy,x.equals(y)should returntrueif and only ify.equals(x)returnstrue. - It is transitive: for any reference values
x,y, andz, ifx.equals(y)returnstrueandy.equals(z)returnstrue, thenx.equals(z)should returntrue. - It is consistent: for any reference values
xandy, multiple invocations ofx.equals(y)consistently returntrueor consistently returnfalse. - For any reference value
x,x.equals(null)should returnfalse.
The
equalsmethod for classObjectimplements the most discriminating possible equivalence relation on objects; that is, for any reference valuesxandy, this method returnstrueif and only ifxandyrefer to the same object (x==yhas the valuetrue).- Parameters:
obj- the reference object with which to compare.- Returns:
trueif this object is the same as the obj argument;falseotherwise.
- It is reflexive: for any reference value
-
-