Structure and Interpretation of Computer Programs gives the following as the conditions that an element of a programming language must satisfy to be considered first-class:
They may be named by variables.
They may be passed as arguments to procedures.
They may be returned as the results of procedures.
They may be included in data structures
How many of these do Java's functions satisfy? If there's any ambiguity, e.g. "does putting a function in an object count for #4?", then please mention that in your answer.
Functions in Java do not have a defined type. We can write things like
Objects::nonNull, but this, in its core, is just syntactic sugar foror(foo) -> Objects.nonNull(foo), which will produce an instance of a functional interface (see JLS, §15.13 and §15.27 respectively). So the methods are always wrapped in an (possibly anonymous) interface implementation.If we compare this to languages like C++, where every function has a defined type, we see that Java lambdas do not satisfy any of this criteria.