java slotA string that represents the value the user spoke for the slot. This is the actual value the user spoke, not necessarily the canonical value or one ofslot public static void testSlot() { int a =…