Brian

48%
Flag icon
Many method references refer to static methods, but there are four kinds that do not. Two of them are bound and unbound instance method references. In bound references, the receiving object is specified in the method reference. Bound references are similar in nature to static references: the function object takes the same arguments as the referenced method. In unbound references, the receiving object is specified when the function object is applied, via an additional parameter before the method’s declared parameters.
Brian
Wow, never done this but I can see where it might be tempting. Starts to result in some magick-looking code (or perhaps just ugly), if you ask me... :/ actually, the inbound case doesn’t seem too bad, unless it’s also accepting arguments in addition to the object that’s the target of the call so that the receiver and the args are all implicit args? Reminds me of the simulated OO straight C dev I did in a class where we defined a bunch of methods whose first argument was always the data struct “handling” the method call...except more hidden.
Effective Java
Rate this book
Clear rating
Open Preview