方法重载的理解

代码一是正确的:
代码一:

public void test(int x,int y){}

public void test(int x,ref int y){}

public void test(int x,int y,string a){}

但代码二则有问题,compiler说已有test成员存在了
代码二:
public void test(int x,int y){}

public int test(int x,int y){return 0;}

可知:重载还是依据参数类型和个数来的,非返回类型矣.
posted @ 2006-06-22 06:15  FallingAutumn  阅读(469)  评论(2编辑  收藏  举报