
service
1 2 3 4
|
public interface { public void test(); }
|
SingletonServiceImpl
1 2 3 4 5 6 7 8 9 10 11 12 13
|
public class SingletonServiceImpl implements { public static int count = 0; public SingletonServiceImpl(){ count++; } @Override public void test() { System.out.println(this); System.out.println(count); } }
|
结果:
[email protected]
1
[email protected]
1
近期评论