PTC interview question

java oops concept , logical problems