Loop an Iterable in Java

If you use some Java API and it returns an Iterable, such as Iterable, you may want to loop this iterable. The method is pretty simple as follows: Iterable<String> result = … //result returned from some method. for(String s: result){ System.out.println(s); }Iterable<String> result = … //result returned from some method. for(String s: result){ System.out.println(s); } … Read more