-3

I was reading about Strategy Design pattern but not able to understand what is significance of this and how and where it is useful? Can some one explain this design pattern with its significance and where it is useful in programming?

Programmer
  • 455
  • 2
  • 8
  • 25

1 Answers1

3

Consider java.util.Comparator. It defines the way two objects are compared. A TreeSet created with different implementations of Comparator will sort elements in different ways. Another example from Java SE is java.util.concurrent.RejectedExcecutionHandler which determines policy to process tasks rejected by ThreadPoolExecutor

Philipp Reichart
  • 20,771
  • 6
  • 58
  • 65
Evgeniy Dorofeev
  • 133,369
  • 30
  • 199
  • 275