Tavant Interview Question

Core Java programs for one of the scenarios