AtomicBoolean toString() method in Java with Examples Last Updated : 27 Feb, 2019 Comments Improve Suggest changes Like Article Like Report The java.util.concurrent.atomic.AtomicBoolean.toString() is an inbuilt method in java that returns the string representation of the current value which is been stored in the boolean. Syntax: public String toString() Parameters: The function does not accepts any parameter. Return Value: The function returns the string representation of the current value. Below programs illustrate the above function: Program 1: Java // Java program that demonstrates // the toString() function import java.util.concurrent.atomic.AtomicBoolean; public class GFG { public static void main(String args[]) { // Initially value as true AtomicBoolean val = new AtomicBoolean(true); String s = val.toString(); // Prints the string value System.out.println("String value: " + s); } } Output: String value: true Program 2: Java // Java program that demonstrates // the toString() function import java.util.concurrent.atomic.AtomicBoolean; public class GFG { public static void main(String args[]) { // Initially value as false AtomicBoolean val = new AtomicBoolean(false); String s = val.toString(); // Prints the string value System.out.println("String value: " + s); } } Output: String value: false Reference: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/atomic/AtomicBoolean.html#toString-- Comment More infoAdvertise with us Next Article AtomicBoolean toString() method in Java with Examples G gopaldave Follow Improve Article Tags : Java Java-Functions Java-concurrent-package Java-AtomicBoolean Practice Tags : Java Similar Reads AtomicLong toString() method in Java with examples The Java.util.concurrent.atomic.AtomicLong.toString() is an inbuilt method in java that returns the string representation of the current value which is been stored in the AtomicLong. Syntax: public String toString() Parameters: The function does not accepts any parameter. Return value: The function 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 AtomicLongArray toString() method in Java with Examples The Java.util.concurrent.atomic.AtomicLongArray.toString() is an inbuilt method in Java that returns a string that textually represents the current values of the AtomicLongArray. The resulting string is a concise and informative representation that is easy for a person to read. It is used to easily 2 min read AtomicReference toString() method in Java with Examples The toString() method of a AtomicReference class is used to return the String representation of the current value of AtomicReference object. Syntax: public String toString() Parameters: This method accepts nothing. Return value: This method returns the String representation of the current value. Bel 1 min read AtomicInteger toString() method in Java with examples The java.util.concurrent.atomic.AtomicInteger.toString() is an inbuilt method in java that returns the string representation of the current value which is been stored in the integer. Syntax: public String toString() Parameters: The function does not accepts any parameter. Return value: The function 1 min read Like