Online Java Compiler By
JavaTpoint.com
public class JavaByteCompareUnsignedExample2 { public static void main(String[] args) { byte b1=-9; byte b2=-10; int val=Byte.compareUnsigned(b1, b2); if(val==0) { System.out.println(b1+" and "+b2+" are equal"); } else if(val>0) { System.out.println(b1+" is greater than "+b2); } else { System.out.println(b2+" is greater than "+b1); } } }
Output