Re:How an Optimizing Compiler Works
by dodobirdlord on Tuesday November 12, 2019 @03:20AM
(#21512463)
Sort of yes but not really. Java has a concept now of a Functional Interface, an interface that has only one abstract method. Classes that implement a functional interface can be treated in a lot of ways like functions, and there is syntactic sugar that amounts to inferring that an object can be treated as a function by calling its only method if it is known in the scope as an interface type with only one method. There's also syntactic sugar for a concept called "lambdas", by which one can inline declare anonymous classes with only one method by just defining the method.
[ Parent
| on HN ]
There are no comments on this comment yet.