-
-
Save iyengarajay/97c5f1e5406bc5a6106c2d0bbf602ce4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public List<String> getNamesOfUKCitizens(List<Person> persons) | |
{ | |
List<String> allUKCitizens = new ArrayList<>(); | |
for(Person p : persons) | |
{ | |
if(p.getCitizenship() == Citizenship.UK){ | |
allUKCitizens.add(p.getName()); | |
} | |
} | |
return allUKCitizens; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment