IBM interview question

oops concepts in java