Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Java Lambdas!
You have completed Java Lambdas!
Preview
Java 8 also introduces method references and allows them to be used anywhere a Functional Interface AKA Single Abstract Method is expected.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
And we can use those in place
of where lambdas are expected.
0:00
The compiler does some
crazy smart stuff for
0:01
you, which we'll explore in
depth in a different course.
0:03
But I wanted to just give you
this version of the code,
0:06
as it's probably the correct way
to solve this using functions.
0:08
It may also be a little hard
to read if it's new to you.
0:11
So let's dupe this,
using lambdas in short form,
0:14
and let's replace this with
using method references.
0:20
The comparator actually added a new
static method called comparing,
0:26
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up