forked from VolodymyrPortianko/topjava03
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
30 lines (26 loc) · 750 Bytes
/
Main.java
File metadata and controls
30 lines (26 loc) · 750 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
27
28
29
30
package ru.javawebinar.topjava;
import java.util.function.Consumer;
/**
* User: gkislin
* Date: 15.01.2015
*
* @link http://javawebinar.ru/topjava/
*/
public class Main {
public static void main(String[] args) {
execute(() -> {
System.out.println("Hello Topjava!");
});
consume(System.out::println, "Hello Topjava!");
}
private static void execute(Runnable runnable) {
System.out.println("Start runner");
runnable.run();
System.out.println("End runner");
}
private static <String> void consume(Consumer<String> consumer, String out) {
System.out.println("Start consume");
consumer.accept(out);
System.out.println("End consume");
}
}