public user(int a,int b)
{
this.a=a;
this.b=b;
}
public user(int a,int b,int c)
{
this(a,b);
this.c=c;
}
在第二个方法中,不能使用第一个方法名来构造,只能使用this,并且只能放在第一行。
this不能用于static方法中,因为this只能用于对象中
Copyright © 2009-2022 www.kswsj.com 成都快上网科技有限公司 版权所有 蜀ICP备19037934号