16 lines
249 B
Java
16 lines
249 B
Java
|
public class TestSingleton {
|
||
|
|
||
|
TestSingleton instance;
|
||
|
|
||
|
TestSingleton() {
|
||
|
}
|
||
|
|
||
|
public TestSingleton getInstance() {
|
||
|
if (instance == null) {
|
||
|
instance = new TestSingleton();
|
||
|
}
|
||
|
return instance;
|
||
|
}
|
||
|
|
||
|
}
|