VOOZH about

URL: https://www.geeksforgeeks.org/java/byte-equals-method-in-java-with-examples/

⇱ Byte equals() method in Java with examples - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Byte equals() method in Java with examples

Last Updated : 11 Jul, 2025
The equals() method of Byte class is a built in method in Java which is used to compare the equality given Object with the instance of Byte invoking the equals() method. Syntax
ByteObject.equals(Object a)
Parameters: It takes an Object type object a as input which is to be compared with the instance of the Byte object calling the equals method. Return Value: It return an boolean value. It returns true if the value of 'a' is equal to the value of ByteObject. Below is the implementation of equals() method in Java: Example 1:
Output:
Does 20 equals 20 : true
Example 2:
Output:
Does 2 equals 20 : false
Comment