AIS interview question

based on java oops Programming