Skip to content

Instantly share code, notes, and snippets.

@FreeFly19
Created December 9, 2016 21:56
Show Gist options
  • Select an option

  • Save FreeFly19/e2da6297de9ec74fc60ea50a441544d4 to your computer and use it in GitHub Desktop.

Select an option

Save FreeFly19/e2da6297de9ec74fc60ea50a441544d4 to your computer and use it in GitHub Desktop.
Jenya refactoring
import java.util.*;
public class App {
public static void main(String[] args) {
ArrayList<String> cities = new ArrayList<>();
//Start
boolean isFound = false;
for (String city : cities) {
if (city.equals("Monte")) {
isFound = true;
break;
}
}
System.out.println("Monte in list of cities: " + isFound);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment