Bidi toString() method in Java with Examples Last Updated : 27 Nov, 2019 Comments Improve Suggest changes Like Article Like Report 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 illustrate the toString() method: Example 1: Java // Java program to demonstrate // toString() method import java.text.*; import java.util.*; import java.io.*; public class GFG { public static void main(String[] argv) { // creating and initializing Bidi Bidi bidi = new Bidi("Geeks", Bidi.DIRECTION_LEFT_TO_RIGHT); // getting the internal state of bidi // using toString() method String status = bidi.toString(); // display the result System.out.println("status of bidi : " + status); } } Output: status of bidi : sun.text.bidi.BidiBase[ dir: 0 baselevel: 0 length: 5 runs: [0 0 0 0 0] text: [0x47 0x65 0x65 0x6b 0x73]] Example 2: Java // Java program to demonstrate // toString() method import java.text.*; import java.util.*; import java.io.*; public class GFG { public static void main(String[] argv) { // creating and initializing Bidi Bidi bidi = new Bidi( "TE1", Bidi.DIRECTION_RIGHT_TO_LEFT); // getting the internal state of bidi // using toString() method String status = bidi.toString(); // display the result System.out.println( "status of bidi : " + status); } } Output: status of bidi : sun.text.bidi.BidiBase[ dir: 2 baselevel: 1 length: 3 runs: [2 2 2] text: [0x54 0x45 0x31]] Reference: https://docs.oracle.com/javase/9/docs/api/java/text/Bidi.html#toString-- Comment More infoAdvertise with us Next Article Bidi toString() method in Java with Examples R rohitprasad3 Follow Improve Article Tags : Java Java-Functions Java-text package Java-Bidi Practice Tags : Java Similar Reads 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() 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 toStrin 2 min read Date toString() method in Java with Examples The toString() method of Java Date class converts this date object into a String in form "dow mon dd hh:mm:ss zzz yyy". This method overrides toString in class object. Syntax: public String toString() Parameters: The function does not accept any parameter. Return Value: It method returns a string re 2 min read 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 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 Class toString() method in Java with Examples The toString() method of java.lang.Class class is used to convert the instance of this Class to a string representation. This method returns the formed string representation. Syntax: public String toString() Parameter: This method does not accept any parameter. Return Value: This method returns the 1 min read Like