MathWorks interview question

Singleton design pattern in C++ and Java.