Java Byte.toString()

Syntax

Byte.toString() has the following syntax.

public String toString()

Example

In the following code shows how to use Byte.toString() method.

The following two examples is showing how to convert byte value to string value.


public class Main {
  public static void main(String[] args) {
    Byte byteObject = new Byte("10");
   //from   w ww.  j av a 2  s  . c om
    String str = byteObject.toString();
    System.out.println("str:"+str);
  }
}

The outputs:





















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