Java Byte(byte value) Constructor

Syntax

Byte(byte value) constructor from Byte has the following syntax.

public Byte(byte value)

Example

In the following code shows how to use Byte.Byte(byte value) constructor.


public class Main {
  public static void main(String[] args) {
//from   w  ww  .  j a v  a  2  s  .  co m

    byte b = 101;
    Byte byteObject2 = new Byte(b);
    System.out.println(byteObject2);

  }
}

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