HCLTech Interview Question

how define class with different type of return type ??