Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class LambdaExpressions {
- interface Foo {
- void bar(Object o);
- }
- static void doo(Foo f) {
- f.bar("baz");
- }
- public static void main(String[] args) {
- doo( x -> {System.out.println(x);});
- }
- }
- new Foo() {
- @Override
- public void bar(Object x) {
- System.out.println(x);
- }
- }
- public static void main(String[] args) {
- Foo f = new Foo() {
- @Override
- public void bar(Object x) {
- System.out.println(x);
- }
- };
- f.bar("baz");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement