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

Popular posts from this blog

php - trouble displaying mysqli database results in correct order -

depending on nth recurrence of job in control M -

sql server - Cannot query correctly (MSSQL - PHP - JSON) -