String vs List to check if a country is part of a continent
Option 1 is sloppy.  By that logic, Guinea is a country in Oceania.  The end-of-string delimiters are an important part of the data and cannot be discarded like that.

Moreover, option 2 has a chance of being faster: if the first few characters fail to match, it can skip to the next item.

However, I would say that neither implementation is recommended.  Better solutions include


A simple data structure that allows searching in O(log n) time:

String[] countries = new String[] { "Countries", "in", "lexicographical", "order" };
boolean isPartOfContinent = (0 &lt;= Arrays.binarySearch(countries, "Country1"));

A more complicated data structure that can perform lookups in constant time.

Set&lt;String&gt; countries = new HashSet&lt;String&gt;(Arrays.asList(…));
boolean isPartOfContinent = countries.contains("Country1");



Considering options 3 and 4 are not any harder to write than options 1 and 2, you might as well choose the better-performing options.