代理方法除了可以
useful when you use frequently composition of classes.
还有什么用吗?而且上面的useful我怎么体会不到啊??
例:
/*
 * Eclipse provide a wizard to add delegate methods. In the editor right click
 * and then Source > Generate delegate Methods or you define a key binding to
 * call the delegate wizard (Window > Prefrences > Workbench > Keys) .
 * 
 */public final class Ugly{
// ...
private String tomCat;
// ... /**
 * delegate method
 */
public char charAt(int arg0) {
return tomCat.charAt(arg0);
}
}

解决方案 »

  1.   

    楼主截止到2008-06-17 19:22:24的汇总数据:
    发帖数:114
    结贴数:24
    结贴率:21.05%
      

  2.   

    LZ 把贴子结了吧。估计你再不结都没人敢回答你的问题了!!
      

  3.   

    对呀,楼主应该结贴了,不然太伤感情了
      

  4.   

    晕,看到结贴率,有人不想回贴子了。。 竹子这招真狠。
      

  5.   

    在坛子里泡这么久,楼主是结帖率最高的了
      

  6.   

    为什么要结贴?这个问题已经解决了么?
      

  7.   

    并不所有的对象都适合代理的,还有啊,看了你的结帖率,还真是令人心寒啊~