What is the use of public final String[] getStringArray(String key) in ResourceBundle?
Aren’t keys in properties files unique? Would this ever return more than one value? If not why does it return an array?
What is the use of public final String[] getStringArray(String key) in ResourceBundle ? Aren’t
Share
If you read carefully the documentation of
ResourceBundle, its says that: –Also: –
So, keys are only unique for a particular locale. In two different locale, you can have keys that are same. That is why the return type is
String[].And for the method –
getStringArray: –