Siemens interview question

Oops concept with other basic core java questions