Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Equivalent of LINQ in Java 8 [duplicate]

Is there an equivalent to LINQ in java 8? Did lambda expression fill this role?

like image 517
Zied.Jabnoun Avatar asked Nov 04 '14 14:11

Zied.Jabnoun


2 Answers

Java's Stream API is the closest thing to .NET's LINQ, in the sense that it allows you to query/manipulate collections in a functional style.

like image 186
dcastro Avatar answered Nov 13 '22 23:11

dcastro


No, lambda expressions are not LINQ equivalent. LINQ (at least parts of it) uses lamba expressions for some functionality. But they're fundamentally different things.

  1. Lambda expressions: expressions used as anonymous functions
  2. LINQ: Language integrated query.
like image 7
Pablo Santa Cruz Avatar answered Nov 13 '22 23:11

Pablo Santa Cruz