ResourceBundle getBaseBundleName() in Java

getBaseBundleName(): This method is available in java.util.ResourceBundle class of Java.

Syntax:

String java.util.ResourceBundle.getBaseBundleName()

This method returns the base name of this bundle, if known, or null if unknown.

Parameters: NA

Returns: The basename of the resource bundle.

Exceptions: NA

Approach

Java

import java.util.Locale;
import java.util.ResourceBundle;

public class ResourceBundlegetBaseBundleName {
    public static void main(String[] args) {

        ResourceBundle bundle =
ResourceBundle.getBundle("Hello", Locale.US);

        System.out.println(bundle.getBaseBundleName());
    }
}

Output:

Hello



No comments:

Post a Comment