开发者

Is there any LINQ like implementation in java? [duplicate]

开发者 https://www.devze.com 2023-02-03 08:32 出处:网络
This question already has answers here: 开发者_StackOverflow中文版 What is the Java equivalent for LINQ? [closed]
This question already has answers here: 开发者_StackOverflow中文版 What is the Java equivalent for LINQ? [closed] (34 answers) Closed 9 years ago.

Just like C# provides me LINQ, is there any package or pre-processor in Java?


Simply put, no. Check out Jon Skeet's answer.


Uhm... yes! See 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();
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号