HSBC interview question

Java concepts