0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Function interface

Posted at

Interface Function<T,​R>
Type Parameters:
T - the type of the input to the function
R - the type of the result of the function

given argumentに対し処理を行い、結果を返す
下記の例はgiven stringのlengthを返す

public class Outer {
    public static void main(String[] args) {
        Function<String, Integer> f = x -> x.length();
        System.out.println(f.apply("abc"));
    }
}
3
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?