在java中是否有类似LINQ的实现?

时间:2011-01-08 05:45:07

标签: c# java linq

就像C#为我提供LINQ,Java中是否有任何软件包或预处理器?

2 个答案:

答案 0 :(得分:2)

简单地说,不。查看Jon Skeet's answer.

答案 1 :(得分:2)

嗯......是的!见https://github.com/nicholas22/jpropel-light

  // create alphabet char[]
  new Character('A').to(new Character('Z')).unbox();

  // join two arrays and put in list 
  alphabet.join(numerics).toList(); 

  // select distinct j* names, using LINQ-style statements
  new String[] { "james", "john", "john", "eddie" }.where(startsWith("j")).distinct();