Java Reference
In-Depth Information
Behavior parameterization is the ability for a method to
take
multiple different behaviors as
parameters and use them internally to
accomplish
different behaviors.
Behavior parameterization lets you make your code more adaptive to changing requirements and
saves on engineering efforts in the future.
Passing code is a way to give new behaviors as arguments to a method. But it's verbose prior to Java 8.
Anonymous classes helped a bit before Java 8 to get rid of the verbosity associated with declaring
multiple concrete classes for an interface that are needed only once.
The Java API contains many methods that can be parameterized with different behaviors, which
include sorting, threads, and GUI handling.
Search WWH ::
Custom Search