Is there a Java equivalent to C#’s ‘yield’ keyword?
The two options I know of is Aviad Ben Dov’s infomancers-collections library from 2007 and Jim Blackler’s YieldAdapter library from 2008 (which is also mentioned in the other answer). Both will allow you to write code with yield return-like construct in Java, so both will satisfy your request. The notable differences between the two are: … Read more