forked from cirosantilli/java-cheat
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
26 lines (20 loc) · 509 Bytes
/
Main.java
File metadata and controls
26 lines (20 loc) · 509 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import java.util.function.IntFunction;
public class Main {
//@Repeatable
//@interface RepeatableAnnotation {}
@interface NotRepeatableAnnotation {}
public static void main(String[] args) {
/*
# Lambda
Define a function without name.
*/
IntFunction<Integer> f = (int x) -> { return x + 1; };
assert f.apply(1) == 2;
/*
# Repeatable
*/
{
// TODO how are all visible at once?
}
}
}