Java · Medium · ProExplain the State pattern. How does it differ from Strategy? Provide a real-world Java example.JavaAdvanced JavaDesign Patterns