Level parse() method in Java with Examples Last Updated : 14 Oct, 2019 Comments Improve Suggest changes Like Article Like Report The parse() method of java.util.logging.Level is used to parse a level name string into a Level. The name of the logging level must be a valid logging name. The argument string may consist of either a level name or an integer value. Level example name: "INFO", "800". Syntax: public static Level parse(String name) throws IllegalArgumentException Parameters: This method accepts a name which is the string to be parsed. Return: This method returns parsed value. Exception: This method throws the following Exception: NullPointerException: if the name is null. IllegalArgumentException: if the value is not valid. Valid values are integers between Integer.MIN_VALUE and Integer.MAX_VALUE, and all known level names. Below programs illustrate parse() method: Program 1: Java // Java program to illustrate parse() method import java.util.logging.Level; public class GFG { public static void main(String[] args) { // Get level of logger using // parse method. Level level = Level.parse("WARNING"); // print result System.out.println("Level = " + level.toString()); } } Output: Level = WARNING Program 2: Java // Java program to illustrate parse() method import java.util.logging.Level; public class GFG { public static void main(String[] args) { // Get level of logger using // parse method. Level level = Level.parse("400"); // print result System.out.println("Level = " + level.toString()); } } Output: Level = FINER References: https://docs.oracle.com/javase/10/docs/api/java/util/logging/Level.html#parse(java.lang.Object) Comment More infoAdvertise with us Next Article Level parse() 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 Level toString() method in Java with Examples 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 thi 1 min read Level equals() method in Java with Examples The equals() method of java.util.logging.Level is used to check if this level object is equals to passed object or not.If both objects are equals then method will return true else false. Syntax: public boolean equals(Object ox) Parameters: This method accepts an object ox which is the reference obje 2 min read Period parse() method in Java with Examples The parse() method of Period Class is used to obtain a period from given string in the form of PnYnMnD where nY means n years, nM means n months and nD means n days. Syntax: public static Period parse(CharSequence text) Parameters: This method accepts a single parameter text which is the String to b 2 min read Level getName() method in Java with Examples The getName() method of java.util.logging.Level is used to get the non-localized string name of the Level. This method return name of this method. Syntax: public String getName() Parameters: This method accepts nothing. Return: This method returns non-localized name of this Level. Below programs ill 1 min read Level intValue() method in Java with Examples The intValue() method of java.util.logging.Level is used to get the integer value for this level object. Every level has an integer value associated with it. This integer value can be used for efficient ordering comparisons between Level objects. This method is helpful if we want to use the int valu 2 min read Like