Explanation
1.Function is a new feature of JDK1.8, which represents a function that receives parameters and generates results.
2. The function of the Function interface is that we can provide it with raw materials and it can produce the final product. Processed through the default methods, combinations, and links it provides.
Examples
Function<String, Integer> toInteger = Integer::valueOf; Function<String, String> backToString = toInteger.andThen(String::valueOf); backToString.apply("123"); // "123"
Collections in Java are mainly divided into four categories:
1, List List: ordered, repeatable;
2, Queue queue: ordered, repeatable;
3, Set collection: non-repeatable;
4, Map mapping: unordered, unique keys, non-unique values.
The above is the detailed content of How to use java Function. For more information, please follow other related articles on the PHP Chinese website!