Level getResourceBundleName() method in Java with Examples
The getResourceBundleName() method of java.util.logging.Level is used to get the localization resource bundle name of this level object. If localization bundle is present then this method returns name of bundle else method return null.
Syntax:
public String getResourceBundleName()
Parameters: This method accepts nothing.
Return: This method returns localization resource bundle name.
Below programs illustrate getResourceBundleName() method:
Program 1:
// Java program to illustrate // getResourceBundleName() method import java.util.ResourceBundle; 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( Object.class.getName()) .getParent(); // Get level of logger Level level = logger.getLevel(); // get localization resource bundle name String name = level.getResourceBundleName(); // print level localization resource bundle name System.out.println("Localization resource" + " bundle name = " + name); } } |
Localization resource bundle name = sun.util.logging.resources.logging
Program 2:
// Java program to illustrate // getResourceBundleName() 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 localization resource bundle name String name = level.getResourceBundleName(); // print level localization resource bundle name System.out.println("Localization resource" + " bundle name = " + name); } } |
Localization resource bundle name = sun.util.logging.resources.logging
References: https://docs.oracle.com/javase/10/docs/api/java/util/logging/Level.html#getResourceBundleName()
Recommended Posts:
- Logger getResourceBundleName() method in Java with Examples
- LogRecord getResourceBundleName() method in Java with Examples
- Level equals() method in Java with Examples
- Level parse() method in Java with Examples
- Level getName() method in Java with Examples
- Level hashCode() method in Java with Examples
- Level intValue() method in Java with Examples
- Level toString() method in Java with Examples
- Level getLocalizedName() method in Java with Examples
- Object level and Class level locks in Java
- Java lang.Long.reverse() method in Java with Examples
- Java lang.Long.numberOfLeadingZeros() method in Java with Examples
- Java lang.Long.builtcount() method in Java with Examples
- Java lang.Long.highestOneBit() method in Java with Examples
- Java lang.Long.byteValue() 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.



