Stephan van Hulst wrote:
Referring to it as a "higher order method" serves no real purpose, and could even be considered wrong, because it implies that it accepts other methods. It doesn't. It accepts functions.
Monica Shiralkar wrote:annomous
Monica Shiralkar wrote:When we have an annomous class implementing a functional interface, and having implementation for the method of this functional interface, then pass object of this annomous class to the higher order function, then what we are actually passing is an object. So why is it said that we are passing function to the higher order function?
Stephan van Hulst wrote:
Monica Shiralkar wrote:annomous
The word "function" in functional languages almost has the same meaning that the word "object" has in object oriented languages..
Monica Shiralkar wrote:annomous
Monica Shiralkar wrote:instead of saying that to the higher order function we are passing object of an annomous class implementing a functional interface, and having implementation for the method of this functional interface,
we can simply say we are passing an anonymous function to it ?
Stephan van Hulst wrote: "anonymous class instance".
Often the most important part of the news is what they didn't tell.
Monica Shiralkar wrote:annomous
Monica Shiralkar wrote:But from just anonymous class instance, it is not clear that which annomous class instance.
Stephan van Hulst wrote:
I'm not sure what you mean. What isn't clear? And why is that important?
Monica Shiralkar wrote:annomous
Monica Shiralkar wrote:annomous
Monica Shiralkar wrote:annomous
Monica Shiralkar wrote:annomous
Monica Shiralkar wrote:So, I think It should be specified that we pass instance of annomous class which implements the functional interface.
Monica Shiralkar wrote:So, I think It should be specified that we pass instance of annomous class which implements the functional interface.
Himai Minh wrote:It does not matter if a class is anonymous or not. During runtime, the Java runtime environment will create an instance for that class.
Stephan van Hulst wrote:
Why? Why is that important? What does it matter?
Stephan van Hulst wrote: a method that accepts a functional interface
Stephan van Hulst wrote:
You're assigning way too much importance to all of this. You understand how the code works, what you can do with it, and you understand what people mean when they say "anonymous class", "function", "functional interface" and "higher order function", or you'll be able to determine it from context. Stop worrying about it.
I am getting the impresssion that we are going in circles about things that don't actually matter.Monica Shiralkar wrote:. . . I think in actual it is an object that it accepts (not interface). . . .
Campbell Ritchie wrote:at runtime a copy of a reference to an object of that type, not the actual object, is passed.
Don't get me started about those stupid light bulbs. |