Hetero Interview Question

Basic java