MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/java/comments/cmt287/achieving_functional_programming_in_java/ew8bjfe/?context=3
r/java • u/mto96 • Aug 06 '19
[removed] — view removed post
12 comments sorted by
View all comments
16
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 interfaceI'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
1
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
2
chronophobia ephemeral lysergic metempsychosis peremptory quantifiable retributive zenith
16
u/jonhanson Aug 06 '19 edited Jul 24 '23
Comment removed after Reddit and Spec elected to destroy Reddit.