Byte toString() method in Java with examples
The toString() method of Byte class is a built in method in Java which is used to return a String value.
public String toString()
Sybtax:
ByteObject.toString()
Return Value: It returns a String object, the value of which is equal to the value of the ByteObject.
Below is the implementation of toString() method:
// Java code to implement // toString() method of Byte class class GFG { public static void main(String[] args) { // byte value byte value = 19; // creating a byte Object Byte b = new Byte(value); // toString() method in Byte class String output = b.toString(); // printing the output System.out.println(output); } } |
19
public static String toString()
Syntax:
Byte.toString(byte b)
Parameters: It takes a byte value b as the parameter which is to be converted to String.
Return Type: It returns a String object, the value of which is equal to the value of the byte ‘b’.
Below is the implementation of toString() method:
// Java code to implement // toString() method of Byte class class GFG { public static void main(String[] args) { // byte value byte value = 19; // toString() method og Byte class String output = Byte.toString(value); // printing the output System.out.println(output); } } |
19
Recommended Posts:
- Java Guava | Bytes.indexOf(byte[] array, byte target) method with Examples
- Java Guava | Bytes.indexOf(byte[] array, byte[] target) method with Examples
- Byte equals() method in Java with examples
- Byte compare() method in Java with examples
- Byte intValue() method in Java with examples
- Byte compareTo() method in Java with examples
- Byte hashCode() method in Java with examples
- Byte shortValue() method in Java with examples
- Byte floatValue() method in Java with examples
- Byte doubleValue() method in Java with examples
- Byte byteValue() method in Java with examples
- Byte longValue() method in Java with examples
- PrintStream write(byte[], int, int) method in Java with Examples
- StringBuffer toString() method in Java with Examples
- DecimalFormatSymbols toString() method in Java with Examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

