r/java • • Aug 06 '19

Achieving Functional Programming in Java

https://youtu.be/VUH_HhAaNpc?list=PLEx5khR4g7PLIxNHQ5Ze0Mz6sAXA8vSPE

[removed] — view removed post

76 Upvotes

12 comments sorted by

View all comments

16

u/jonhanson Aug 06 '19 edited Jul 24 '23

Comment removed after Reddit and Spec elected to destroy Reddit.

1

u/TheStrangeDarkOne Aug 07 '19

This is just wrong - pure should be a static function, which clearly isn't possible in an interface

I'm not sure I understand your problem, but...

public interface Foo {
    static <T> T identity(T item) { return item; }
}

... compiles without a problem.

2

u/jonhanson Aug 07 '19 edited Mar 07 '25

chronophobia ephemeral lysergic metempsychosis peremptory quantifiable retributive zenith