java - Why can't I assign lambda to Object? -
i trying assign lambda object type:
object f = ()->{};
and gives me error saying:
target type of expression must functional interface
why happening, , how this?
it's not possible. per error message object
not functional interface, interface single public method need use reference type is, e.g.
runnable r = () -> {};
Comments
Post a Comment