The toString() method of Boolean class is a built in method to return the boolean value in string format.
There are 2 overloads of toString() methods in Boolean class of Java:
public static String toString(boolean value)
Parameter: It takes a boolean value as input which is to be converted to string.
Return Type: The returned value is String representation of the Boolean Value.
Below are programs to illustrate toString() method:
public String toString()
Return Type: The returned value is a String representation of the boolean instance by which this method is called.
Below are programs to illustrate above defined method:
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.