Java Byte.equals(Object obj)

Syntax

Byte.equals(Object obj) has the following syntax.

public boolean equals(Object obj)

Example

In the following code shows how to use Byte.equals(Object obj) method.


public class Main {
  public static void main(String[] args) {
    /*w ww  .ja  v  a  2  s . co m*/
    Byte byte1 = new Byte("1");
    Byte byte2 = new Byte("2");
    System.out.println(byte1.equals(byte2));
  }
}

The output:





















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