Byte compare(byte x, byte y)
compares two byte values.
compare
has the following syntax.
public static int compare(byte x, byte y)
compare
has the following parameters.
compare
returns
In the following code shows how to use Byte.compare(byte x, byte y) method.
public class Main { public static void main(String[] args) { byte b1 = 1; byte b2 = 2; System.out.println( Byte.compare(b1,b2)); } }
The code above generates the following result.