Strategy design pattern is one of the behavioral design pattern. Strategy pattern is used when we have multiple algorithm for a specific task and client decides the actual implementation to be used at runtime. Strategy pattern is also known as Policy Pattern.
One of the best example of strategy pattern isÂ
1 | Collections.sort(anyCollection, Comparator implemetation) |
 method that takes Comparator parameter. Based on the different implementations of Comparator interfaces, the Objects are getting sorted in different ways.