forked from hacker85/JavaLessons
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLambdasLesson.java
More file actions
31 lines (29 loc) · 861 Bytes
/
LambdasLesson.java
File metadata and controls
31 lines (29 loc) · 861 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
31
package java8;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class LambdasLesson {
public static void main(String[] args) {
Runnable runnable = new Runnable() {
@Override
public void run() {
System.out.println("hello");
}
};
ActionListener actionListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
System.out.println("hello");
}
};
Runnable runnable1 = () -> System.out.println("hello");
String s = "hello";
ActionListener actionListener1 = (ActionEvent event) -> {
System.out.println(s);
};
//A a = () -> System.out.println("hello");
}
}
interface A {
void one(int i);
void two();
}