【发布时间】:2016-02-04 12:18:21
【问题描述】:
主类->>>
public class scoreMain {
public static void main(String[] args) {
// Football Score board
Score scoreObject = new Score();
Score scoreObject1 = new Score(1);
Score scoreObject2 = new Score(1,2);
Score scoreObject3 = new Score(1,2,3);
}
}
和构造函数类-->>>
public class Score {
public void Score()
{
Score(0,0,0);
}
public void Score(int x)
{
Score(x,0,0);
}
public void Score(int x,int y)
{
Score(x,y,0);
}
public String Score(int x,int y,int z)
{
Score(x,y,z);
return String.format("%d/%d%d",x,y,z);
}
}
但在创建对象时显示错误... 构造函数 score(int) 未定义 构造函数 score(int int) 未定义 构造函数得分(int int int)未定义
【问题讨论】:
标签: java