DS Group interview question

They asked me about the basic oops and java problem