ResourceBundle toString() in Java

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

Syntax:

String java.lang.Object.toString()

This method returns a string representation of the object.

Parameters: NA

Returns: a string representation of the object.

Exceptions: NA

Approach

Java

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

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

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

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

Output:

java.util.PropertyResourceBundle@3567135c


No comments:

Post a Comment