Created
November 26, 2019 07:57
-
-
Save hongbeomi/66d042b526fa179e219b168e8a8530d2 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
enum Color { RED, GREEN } | |
public static List<Apple> filterGreenApples(List<Apple> inventory) { | |
List<Apple> result = new ArrayList<>(); // 사과 누적 리스트 | |
for(Apple apple: inventory){ | |
if( GREEN.equals(apple.getColor())) { // 녹색 사과만 선택 | |
result.add(apple); | |
} | |
} | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment