Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[medium snippets] #medium #designPattern #StatePattern
public class ClientDemo {
public static void main(String[] args) {
MP3PlayerContext mp3Player = new MP3PlayerContext();
mp3Player.press();
mp3Player.getState();
mp3Player.press();
mp3Player.getState();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment