028-86922220
建站资讯

网站建设资讯

为你提供网站建设行业资讯、网站优化知识、主机域名邮箱、网站开发常见问题等。

java构造类方法

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只能用于对象中

名称栏目:java构造类方法
转载来源:http://whjierui.cn/article/goochd.html

其他资讯