Re:Kotlin: A New Hope in a Java 6 Wasteland
by mike_hearn on Tuesday September 29, 2015 @07:20AM
(#10295559)
Alright, in that case Kotlin has that other sense of first class functions as well. You can get a function typed object that supports the invoke operator, amongst other things.
That said, I agree with you that Java does not have first class functions. They have something tacked on that is nowhere as elegant and lacks full support.
On the other hand, not every language that lets you define functions outside of classes lets you treat them like objects. C for example is generally not considered a language with true first class functions because it doesn't allow passing nested ones without additional support within the chosen complier.