No C#?
using System.Linq;
class Filter
{
static void Main()
{
var a = new []{1, 2, 3, 4}.Where(x=>x%2==0);
System.Console.WriteLine(a);
}
}
It's unclear if printing is necessary or not, as the Java one does an explicit print, but the others don't. using System.Linq;
class F {
static void Main() {
new[] {1, 2, 3, 4}.Where( i => i % 2 > 0 ).ToList().ForEach(
System.Console.WriteLine
);
}
}