Search the courses, subjects, tracks, games and features, or jump straight to a page.
3 cards from this section. Quick, good the night before a test.
What is the syntax for a method reference?
Think about how you would refer to a method of a class.
Give an example of using a method reference to print elements of a list.
What method do you use to print elements in a collection?
What is a method reference used for in Java?
Consider the purpose of a reference in programming.
True or False: Method references reduce the amount of boilerplate code written.
Think about the differences in the code structure.
Create a Java program that uses method references to sort a list of integers in reverse order, using the Collections.sort method.
Remember how method references can change the way we think about traditional sorting methods.
Using method references, write a program that takes a list of names and converts them to lowercase and sorts them.
Think about how to combine method references with other stream operations.
5 more questions in this section. Enroll free to practise them all.
Enroll free