This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Help with Functional programming with Java Camera.java code  RSS feed

 
terry dhariwal
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In this code, the method setFilters is expecting a List of Functional Interfaces (Function<Color,Color> filters).

I don't understand how the code compiles successfully because in the main method we are calling setFilters with a method-reference argument (Color::brighter, Color::darker) which expects a list of Functional interfaces. However Color is not a functional interface.

Can anyone clarify how this works?

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!