S
More benefits than? In creating whole classes to simulate the same result? After all lick uses class infrastructure to work. So the concision is probably the biggest win. And that's not much.I would say that along with the concision comes code simplification, it makes everything set in one place. And simplification helps to avoid mistakes that could be made if you had to do everything in hand.The use of anonymous classes helps at least stay where everything is being consumed, but it is still too unreadable, too unreadable, gets lost in the flow.To better state the intention is another very important point. And that's not much. You want more than that?A lick itself gives no more power or flexibility because everything can be done without it.It is that thing, if you do not want concision, simplification and robustness, then program in Assembly All that exists in high-level languages is about concision, simplification, robustness and giving the author's opportunity to better declare his intention.Functional styleIts use makes a little change the programming style and adopted patterns. It allows better abstractions without complications. The code tends to be https://pt.stackoverflow.com/q/81854/101 .Java was a language that was born a little defending that the imperative is not good, but the declarative is what counterposes the imperative, not the orientation to the object. https://pt.stackoverflow.com/q/127121/101 is more concise and lick is a fundamental concept of this paradigm. This is a significant gain for expressivity and readability, but it has to do with intent.Where is usedAn example is that you do not need to create a new class to customize behavior, since the original class supports this the object itself can customize what to do in a given situation. At that point lick can work as a virtual method. Indeed the mechanism is identical. It is you have a pointer for a function that will still be defined in the object, only the lick allows the consumer to do whatever they want, but it is equal to a virtual method. This can be good or bad, not always what you want.Another point is when you need to call a method in a class that has no direct relation to inheritance, how does it do? It is usually created a class that can be abstract or interface that maintains a contract for this method and a concrete class derived from it is created to be consumed by another class that expects the class or interface base, so she knows that it can call the desired method that it will exist in that class. It is usually a lot of complication, a lot of code to get the desired result.Imagine having to create a class every time you need a stream stream stream stream stream stream (I hate that name, confuse with https://pt.stackoverflow.com/q/227339/101 , despite being the same concept). Certainly this is a huge beneficiary. With this you can create https://pt.stackoverflow.com/q/45020/101 and simplify the creation of https://pt.stackoverflow.com/q/36655/101 . What was even the sptopim for the creation of C#. I always knew that one day Java would have that to survive, there was an arm drop by egos in the case.Other earningsI could say that the best abstraction is an extra gain not quoted in the question, but actually could always do. People didn't do it because it wasn't concise. And a little too because, in general, they follow cake recipes and before licking seldom someone made a recipe showing how to do this way. That's why I always say to everyone to learn all concepts, fundamentals, paradigms, learn "strange" languages just to see different ways of doing what you want.So I don't even know if there's so much gain in the expression of intent, it could always do, the concision is that it encouraged it to do better.So if the gain basically is known by the AP and that it should know codes that give more concision and better intent, then I have no code examples to post.