Infosys Interview Question

oops , logical questions , java