这是我的代码。当我使用 bluej 编译时,它会突出显示最后一个 } 并说缺少 return 语句。我不能放 void 因为它是一个布尔值。有任何想法吗?
public boolean runAJob() {
boolean jobsFinished = false;
Job firstJob = getCurrentJob();
String jobName = firstJob.getName();
int jobDuration = firstJob.getDuration();
if (!myJob.isEmpty()&& jobDuration > 0 && jobDuration <= myTotalDuration) {
myTotalDuration -= jobDuration;
myFinishedJobs.add(myJob.get(0));
myJob.remove(0);
System.out.println("'"+jobName+"'" +" is completed. "+ myTotalDuration+ " seconds remaining on the clock");
jobsFinished = true;
} else {
System.out.println("JobQueue is empty");
}
}