FDM Group Interview Question

write a java class and with the desired behavior