Java code that simulates a telephone keypad.