文章列表
package com.huawei.c3.adapter;
public class Singleton
{
//声明类实例,在类加载时进行初始化。
private final static Singleton instance=new Singleton();
private Singleton(){
}
public static Singleton getInstance(){
return instance;
...
[置顶] java代理模式(动态代理的实现)
- 博客分类:
- 设计模式
希望各位拍砖:
package com.huawei.c3.proxypattern;
public interface IPerson
{
void say();
void eat();
void sleep();
}
package com.huawei.c3.proxypattern;
public class Teacher implements IPerson
{
@Override
public void say()
{
Syst ...