LTM Limited interview question

java coding question and oops concepts.