Online Java Compiler By
JavaTpoint.com
public class JavaByteEqualsExample1 { public static void main(String[] args) { Byte byte1=127; Byte byte2=67; //It compares two Byte objects numerically boolean val=byte1.equals(byte2); if(val){ System.out.println(byte1+" and "+byte2+" values are equal."); } else{ System.out.println(byte2+" and "+byte1+" are not equal."); } } }
Output