Home > Java > javaTutorial > How to use java Function

How to use java Function

王林
Release: 2023-05-14 23:52:04
forward
1794 people have browsed it

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"
Copy after login

What collection classes are there in Java

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!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template