问题是:
Clock
的定义。 这是我到目前为止所拥有的
public class Clock {
private int hours;
private boolean isTicking;
private Integer diff;
public Clock ( int hours, boolean isTicking, Integer diff;) {
this.hours = hours; this.isTicking = isTicking; this.diff = diff;
}
}
答案 0 :(得分:1)
除了假分号外,这看起来还不错:
public Clock ( int hours, boolean isTicking, Integer diff;
^ THIS
删除它,你会很高兴。
修复了它们 - 显然,我认为使用“int”而不是“Integer”。但为什么呢?
据我所知,使用Integer
你已按照信中的说明进行操作。问你的导师。
答案 1 :(得分:0)
public Clock ( int hours, boolean isTicking, Integer diff;)
应该是
public Clock ( int hours, boolean isTicking, Integer diff)
答案 2 :(得分:0)
冒号然后它才能正常运行。它应该是
public Clock ( int hours, boolean isTicking, int diff)
答案 3 :(得分:0)
public Clock ( int hours, boolean isTicking, Integer diff;)
在Integer diff