Siemens interview question

java q's