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