Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private List<String> countriesList = new ArrayList<String>();
- public List<String> getCountriesList() {
- String[] locales = Locale.getISOCountries();
- for (String countryCode : locales) {
- Locale obj = new Locale("", countryCode);
- countriesList.add(obj.getDisplayCountry(Locale.FRENCH));
- }
- return countriesList;
- }
- Collections.sort(countriesList, new Comparator<String>() {
- @Override
- public int compare(String str1, String Str2)
- {
- return str1.compareTo(str2);
- }
- });
- List<String> countriesList = new ArrayList<String>();
- String[] locales = Locale.getISOCountries();
- for (String countryCode : locales) {
- Locale obj = new Locale("", countryCode);
- countriesList.add(obj.getDisplayCountry(Locale.FRENCH));
- Collections.sort(countriesList);
- }
- for(String s:countriesList)
- {
- System.out.println(s);
- }
- private List<String> countriesList = new ArrayList<String>();
- public List<String> getCountriesList() {
- String[] locales = Locale.getISOCountries();
- for (String countryCode : locales) {
- Locale obj = new Locale("", countryCode);
- countriesList.add(obj.getDisplayCountry(Locale.FRENCH));
- }
- return Collections.sort(countriesList);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement