[AppleScript] 纯文本查看 复制代码
interface Waiter{
public void server();
}
public class Waitress implements Waiter{
public void server(){
System.out.println(“服务中…”);
}
}
public class WaitressWrapper implements Waiter{
private Waiter waiter;
public WaitressWrapper(Waiter waiter){
this.waiter = waiter;
}
public void server(){
System.out.println(“微笑…”)
waiter.server();
}
}
[AppleScript] 纯文本查看 复制代码
public class MyConnectionWrapper extends ConnectionWrapper{
private Connection conn;
private List<Connection> connList;
public MyConnectionWrapper(Connection conn,List<Connection> connList) {
super(conn);
this.conn = conn;
this.connList= connList;
}
// 增强某个方法:
@Override
public void close() throws SQLException {
// super.close();
// 归还连接:
connList.add(conn);
}
}