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 value of a level object for comparison purposes in logging.
Syntax:
public int intValue()
Parameters: This method accepts nothing.
Return: This method returns the integer value for this level object.
Below programs illustrate intValue() method:
Program 1:
// Java program to illustrate // intValue() 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 intValue int val = level.intValue(); // print result System.out.println("intValue = " + val); } } |
intValue = 800
Program 2:
// Java program to illustrate // intValue() 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 int code int value = level.intValue(); // print result System.out.println("intValue = " + value); } } |
intValue = 1000
References: https://docs.oracle.com/javase/10/docs/api/java/util/logging/Level.html#intValue()
Attention reader! Don’t stop learning now. Get hold of all the important Java and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready.
Recommended Posts:
- Number.intValue() method in java with examples
- Byte intValue() method in Java with examples
- Double intValue() method in Java with examples
- Float intValue() method in Java with examples
- LongAdder intValue() method in Java with Examples
- DoubleAdder intValue() method in Java with Examples
- LongAccumulator intValue() method in Java with Examples
- AtomicInteger intValue() method in Java with examples
- AtomicLong intValue() method in Java with examples
- DoubleAccumulator intValue() method in Java with Examples
- BigDecimal intValue() Method in Java
- Integer intValue() Method in Java
- BigInteger intValue() Method in Java
- Object level and Class level locks in Java
- Level getResourceBundleName() method in Java with Examples
- Level hashCode() method in Java with Examples
- Level getName() method in Java with Examples
- Level parse() method in Java with Examples
- Level getLocalizedName() method in Java with Examples
- Level equals() method in Java with Examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

