Java Byte.compare(byte x, byte y)

Syntax

Byte.compare(byte x, byte y) has the following syntax.

public static int compare(byte x,  byte y)

Example

In the following code shows how to use Byte.compare(byte x, byte y) method.


public class Main {
// w w w .  j av  a 2s.  co  m
   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.





















Home »
  Java Tutorial »
    java.lang »




Boolean
Byte
Character
Class
Double
Enum
Float
Integer
Long
Math
Number
Object
Package
Process
ProcessBuilder
Runnable
Runtime
SecurityManager
Short
StackTraceElement
StrictMath
String
StringBuffer
StringBuilder
System
Thread
ThreadGroup
ThreadLocal
Throwable