Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package SingeltonPattern;
- public class Singelton {
- private static Singelton instance;
- private Singelton() {
- }
- public static Singelton getInstance() {
- if (instance == null) {
- instance = new Singelton();
- }
- return instance;
- }
- }
- class SingeltonTest {
- public static void main(String[] args) {
- System.out.println(Singelton.getInstance());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement