IT/Java

Java - 싱글톤

노마드오브 2018. 11. 24. 20:36

class MyDog {

static MyDog m = new MyDog();

private MyDog() {

}

}



public class Animal {


public static void main(String[] args) {

MyDog dog = MyDog.m;

}


}