Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. public List<Country> getCountryNameStartsWithC(List<Country> countryList) {
  2.  
  3. List<Country> countryNameList = new ArrayList<>();
  4.  
  5. for (Country country : countryList) {
  6. if (country.getCountryName().startsWith("C")) {
  7. countryNameList.add(country);
  8. }
  9. }
  10.  
  11. return countryNameList;
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement