Level toString() method in Java with Examples Last Updated : 14 Oct, 2019 Comments Improve Suggest changes Like Article Like Report The toString() method of java.util.logging.Level is used to get the string value which represents this Level.This method returns a string representation of this Level. Syntax: public String toString() Parameters: This method accepts nothing. Return: This method returns a string representation of this Level.. Below programs illustrate toString() method: Program 1: Java // Java program to illustrate toString() method import java.util.logging.Level; import java.util.logging.Logger; public class GFG { public static void main(String[] args) { // Create a Logger Logger logger = Logger.getLogger( String.class.getName()) .getParent(); // Get level of logger Level level = logger.getLevel(); // get string value of level String val = level.toString(); // print result System.out.println("toString = " + val); } } Output: toString = INFO Program 2: Java // Java program to illustrate toString() method import java.util.logging.Level; public class GFG { public static void main(String[] args) { // Get level of logger Level level = Level.parse("SEVERE"); // get string representation String value = level.toString(); // print result System.out.println("toString = " + value); } } Output: toString = SEVERE References: https://docs.oracle.com/javase/10/docs/api/java/util/logging/Level.html#toString() Comment More infoAdvertise with us Next Article Level toString() method in Java with Examples A AmanSingh2210 Follow Improve Article Tags : Java Java-Functions Java-Level java.util.logging package Practice Tags : Java Similar Reads Locale toString() Method in Java with Examples The toString() method of Locale class in Java is used to return a string representation of this locale. Each element i.e., the language, country or the variant of the locale is separated by underbars Syntax: LOCALE.toString() Parameters: This method does not take any parameters. Return Value: This m 1 min read Matcher toString() method in Java with Examples The toString() method of Matcher Class is used to get the String representation of this matcher. This method is derived from the Object Class and behaves in the similar way. Syntax: public String toString() Parameters: This method takes no parameters. Return Value: This method returns a String value 2 min read Year toString() method in Java with Examples The toString() method of Year class in Java is used to return the string representation of this Year object. Syntax: public String toString() Parameter: This method does not accepts any parameter. Return Value: It returns the string representation of this Year object. Below programs illustrate the t 1 min read 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 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 Path toString() method in Java with Examples The Java Path interface was added to Java NIO in Java 7. toString() method of java.nio.file.Path used to return the string representation of this path. If this path was created by converting a path string using the getPath method then the path string returned by this method may differ from the origi 2 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 Field toString() method in Java with Examples The toString() method of java.lang.reflect.Field is used to get a string describing this Field. The format of the returned string is the access modifiers for the field, if any, followed by the field type, followed by a space, followed by the fully-qualified name of the class declaring the field, fol 3 min read String toString() Method in java with Examples String toString() is the built-in method of java.lang which return itself a string. So here no actual conversion is performed. Since toString() method simply returns the current string without any changes, there is no need to call the string explicitly, it is usually called implicitly. Syntax : publ 1 min read Like