Byte toString() method in Java with examples Last Updated : 18 Jan, 2022 Comments Improve Suggest changes Like Article Like Report The toString() method of Byte class is a built in method in Java which is used to return a String value. public String toString() Syntax: 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 // 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); } } 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 // 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); } } Output: 19 Comment More infoAdvertise with us Next Article Byte toString() method in Java with examples S ShivamKD Follow Improve Article Tags : Java Java - util package Java-Functions Java-Byte java-lang-reflect-package +1 More Practice Tags : Java Similar Reads BitSet toString() Method in Java with Examples The java.util.BitSet.toString() is an inbuilt method of BitSet class that is used to get a string representation of the bits of the sets in the form of a set of entries separated by â, â. So basically the toString() method is used to convert all the elements of BitSet into String. In addition to thi 2 min read ByteBuffer toString() method in Java with Examples The toString() method of ByteBuffer class is the inbuilt method used to returns a string representing the data contained by ByteBuffer Object. A new String object is created and initialized to get the character sequence from this ByteBuffer object and then String is returned by toString(). Subsequen 2 min read Bidi toString() method in Java with Examples The toString() method of java.text.Bidi class is used to display this Bidi instance in string representation. Syntax: public String toString() Parameter: This method accepts nothing as parameter. Return Value: This method display internal state of bidi in string format. Below are the examples to ill 2 min read Charset toString() method in Java with Examples The toString() method is a built-in method of the java.nio.charset returns a string which describes the charset involved. Syntax: public final String toString() Parameters: The function does not accepts any parameter. Return Value: The function returns a string describing this charset. Below is the 1 min read Duration toString() method in Java with Examples The toString() method of Duration Class in java.time package is used to get the String value of this duration. This String is in the ISO-8601 format. Syntax: public String toString() Parameters: This method do not accepts any parameter. Return Value: This method returns a String value which is the S 1 min read Like