The process decides whether the Number object that incorporates the methodology is equivalent to the class that is passed as an argument.
public boolean equals(Object o)
Here is the detail of parameters −
public class Test { public static void main(String args[]) { Integer x = 5; Integer y = 10; Integer z =5; Short a = 5; System.out.println(x.equals(y)); System.out.println(x.equals(z)); System.out.println(x.equals(a)); } }
This will produce the following result:
false true false
Here at Intellinuts, we have created a complete Java tutorial for Beginners to get started in Java.