Code: Select all
Locale myLoc = new Locale(new Locale("fr", "FR"));
ResourceBundle rb = ResourceBundle.getBundle("appmessages", myLoc);
Code: Select all
Locale myLoc = new Locale("fr", "FR");
ResourceBundle rb = ResourceBundle.getBundle("appmessages", myLoc);
Code: Select all
ResourceBundle rb = ResourceBundle.getBundle("appmessages", Locale.CHINA);
If this is not a realistic Oracle scenario, I would find it clearer to state the possible solutions with reassignments (instead of declaring the same variable again):
Code: Select all
rb = ResourceBundle.getBundle("appmessages", Locale.CHINA);