HCLTech interview question

how define class with different type of return type ??