Lambda Expressions in Java 8 by Nguyen Van
Author:Nguyen, Van [Nguyen, Van]
Language: eng
Format: azw3
Published: 2016-12-29T16:00:00+00:00
Sample Code
String[] friendList = {"Tuan", "Nam", "Lan"};
Arrays.sort(friendList,
(friend01, friend02) ->
Integer.compare(friend01.length(), friend02.length()));
System.out.print(Arrays.toString(friendList));
Output
[Lan, Nam, Tuan]
Multiple lines of code
If your code cannot be written in 1 line, it can be enclosed in {} and your code now should explicitly contain a return statement
Sample Code
String[] friendList = {"Tuan", "Nam", "Lan"};
Arrays.sort(friendList,
(String friend01, String friend02) ->
{
if (friend01.length() > friend02.length())
return -1;
else
return 0;
});
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
| Ada | Ajax |
| Assembly Language Programming | Borland Delphi |
| C & C++ | C# |
| CSS | Compiler Design |
| Compilers | DHTML |
| Debugging | Delphi |
| Fortran | Java |
| Lisp | Perl |
| Prolog | Python |
| RPG | Ruby |
| Swift | Visual Basic |
| XHTML | XML |
| XSL |
The Mikado Method by Ola Ellnestam Daniel Brolund(11877)
Hello! Python by Anthony Briggs(11791)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(11240)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(9832)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(9420)
Grails in Action by Glen Smith Peter Ledbrook(9163)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(8808)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(8594)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(8309)
Windows APT Warfare by Sheng-Hao Ma(7776)
Layered Design for Ruby on Rails Applications by Vladimir Dementyev(7485)
Blueprints Visual Scripting for Unreal Engine 5 - Third Edition by Marcos Romero & Brenden Sewell(7395)
Kotlin in Action by Dmitry Jemerov(7263)
Solidity Programming Essentials by Ritesh Modi(4529)
Hands-On Full-Stack Web Development with GraphQL and React by Sebastian Grebe(4412)
WordPress Plugin Development Cookbook by Yannick Lefebvre(4342)
Unity 3D Game Development by Anthony Davis & Travis Baptiste & Russell Craig & Ryan Stunkel(4236)
The Ultimate iOS Interview Playbook by Avi Tsadok(4217)
Functional Programming in JavaScript by Mantyla Dan(4216)