Skip to content

Commit 114b784

Browse files
committed
1 parent 2fffc46 commit 114b784

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/lambdas/method_references.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ interface Drummer {
3434
void drum();
3535
}
3636

37+
interface Musician {
38+
void play();
39+
}
40+
3741
class Main {
3842
void doDrum() {
3943
IO.println("ratatatatat");
@@ -46,7 +50,8 @@ class Main {
4650
Drummer drummer = this::doDrum;
4751
drummer.drum();
4852

49-
Runnable run = drummer::drum;
53+
Musician musician = drummer::drum;
54+
musician.play();
5055
}
5156
}
5257
```

0 commit comments

Comments
 (0)