// The Guitar interface specifies a set of methods that can be used to play a // musical instrument that can play various notes that correspond to // characters. The characters would normally be keys typed by the user, but // any character mapping will work. public interface Guitar { // returns whether there is a string that corresponds to this character public boolean hasString(char key); // plucks the string for this character public void pluck(char key); // plays the current sound (sum of all strings) public void play(); // advances the simulation by having each string tic forward public void tic(); }