I’ve started following this very promising blog by the “Geeks From Paradise”. Apart from the fact that I’m a bit envious of geeks living in Costa Rica, this comparison of the upcoming Java 8 Streams API with various of .NET’s LINQ API capabilities is a very interesting read.
A preview of what you’ll find there (just one of 19 examples):
LINQ
List<string> nameList1 = new List(){
"Anders", "David", "James",
"Jeff", "Joe", "Erik" };
nameList1.Select(c => "Hello! " + c).ToList()
.ForEach(c => Console.WriteLine(c));
Java Streams
List<String> nameList1 = asList(
"Anders", "David", "James",
"Jeff", "Joe", "Erik");
nameList1.stream()
.map(c -> "Hello! " + c)
.forEach(System.out::println);
Read the full blog post here:
http://blog.informatech.cr/2013/03/24/java-streams-preview-vs-net-linq/Like this:
Like Loading...
Published by lukaseder
I made jOOQ
View all posts by lukaseder
The C# code can be replace for the most clear:
Note that the foreach instruction accepts the method name too
Thanks for the suggestion. We simply copied a single example from the linked blog post. I guess we’ll leave it the way it is for now