Properties vs Resource Bundle

前端 未结 3 541
旧巷少年郎
旧巷少年郎 2020-12-23 19:34

I read about properties and resource bundle. But I was unable to get difference between these. When to use Properties file and when to use Resource bundle.

T

3条回答
  •  Happy的楠姐
    2020-12-23 19:55

    1. Properties usually used for configuration file, not designed for internationalization (i18n) file. Such as log4j.properties or as your own configuration file.
    2. ResourceBundle is used for internationlization (i18n), the "magic" of ResourceBundle is not only key-value pair, but it can set to spesific Locale (language,region/country,variant) with the same key.

    So, yes. it depends on what you need.

提交回复
热议问题