[OOP] Singleton, Doubleton, Mutilton
1. Singleton public class SerialNumberGenerator { private int count = 0; private SerialNumberGenerator() { } private static class SerialHolder { private static final SerialNumberGenerator serial = new SerialNumberGenerator(); } public static SerialNumberGenerator getInstance() { return SerialHolder.serial; } public int getNext() { return ++count; } } public class SerialNumberGenerator { private ..
Paradigm/OOP
2013. 4. 19. 22:42
최근에 올라온 글
최근에 달린 댓글
글 보관함
- Total
- Today
- Yesterday