Its an interface with only method. I suspect that most of us would just us a lambda now.
Re:Please put units in names
by contravariant on Monday March 21, 2022 @09:26AM
(#30753842)
I'll never quite understand why it wasn't simply a function in the first place.
Java pre-8 only had anonymous classes, there were no lambdas
Re:Please put units in names
by fiddlerwoaroof on Monday March 21, 2022 @11:39AM
(#30755308)
And Java lambdas are still syntax sugar for one-method anonymous classes.
Edit: Also, overriding a class method dynamically inside a function? I usually program python these days and even I think that's wild.