Barclays interview question

different way of creating singleton class.