If the key red is in all four of these files, which file will the following code use for the resource bundle?.
Locale loc = new Locale("zh", "CN"); Locale.setDefault(new Locale("en", "US")); ResourceBundle rb = ResourceBundle.getBundle("Colors", loc); rb.getString("red");
D.
Since a Locale is passed when requesting the ResourceBundle, that Locale is used first when looking for bundles.
Since there isn't a bundle called Colors_zh_CN.properties, Java goes on to check for the language.
Option D provides a match on language.
If this was not found, Java would go on to the default locale, eventually matching Option B.
Since country is not used without language, Options A and C would not be considered as options.