Java Object.equals(Object obj)
Syntax
Object.equals(Object obj) has the following syntax.
public boolean equals(Object obj)
Example
In the following code shows how to use Object.equals(Object obj) method.
/*from w w w. ja v a 2 s .c o m*/
public class Main {
public static void main(String[] args) {
Integer x = new Integer(50);
Float y = new Float(50f);
System.out.println(x.equals(y));
System.out.println(x.equals(50));
}
}