mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-25 19:21:16 +07:00
20 lines
340 B
Java
20 lines
340 B
Java
import java.util.function.Function;
|
|
|
|
class Foo {
|
|
Bar frobnitz(Function<Foo, Bar> f) {
|
|
return f.apply(this);
|
|
}
|
|
}
|
|
|
|
class Bar {
|
|
static Bar frob(Bar anObject, Foo foo) {
|
|
return anObject;
|
|
}
|
|
}
|
|
|
|
class Baz {
|
|
public static void main(String[] args) {
|
|
Bar bar = new Bar();
|
|
new Foo().frobnitz(foo -> Bar.frob(bar, foo));
|
|
}
|
|
} |