-3

我试图创建一个程序,但我遇到了一些我无法消除的错误。有人可以帮帮我吗?

        import java.util.Scanner;

class julianDate {
    long year;
    long month;
    long day;
    long EPOCHYEAR;


      julianDate() {
      }


long returnJulianEpochDays(long year, long month, long day){
long yearCounter = EPOCHYEAR;
long total = 0;

while (yearCounter < year){

total += returnDaysInYear(yearCounter);

yearCounter += 1;

 }
  total += returnJulianDate(long year, long month, long day);
  return total;
  }

}

 public class julianDateNew {



    }

错误:

这些是我在编译程序时遇到的错误:

/Users/NetBeansProjects/JavaApplication1/src/julianDateNew.java:25: '.class' expected
  total += returnJulianDate(long year, long month, long day);

/Users/NetBeansProjects/JavaApplication1/src/julianDateNew.java:25: ';' expected
  total += returnJulianDate(long year, long month, long day);

/Users/vlopezlama/NetBeansProjects/JavaApplication1/src/julianDateNew.java:25: <identifier> expected
  total += returnJulianDate(long year, long month, long day);

/Users/NetBeansProjects/JavaApplication1/src/julianDateNew.java:25: not a statement
  total += returnJulianDate(long year, long month, long day);

/Users/etBeansProjects/JavaApplication1/src/julianDateNew.java:25: ';' expected
  total += returnJulianDate(long year, long month, long day);
4

1 回答 1

1

这个声明没有意义:

total += returnJulianDate(long year, long month, long day);

由于您正在对 进行方法调用returnJulianDate,因此您只想将声明的变量传递给该类型:

total += returnJulianDate(year, month, day);

现在,如果该方法returnJulianDate不存在,那么您还有另一个问题需要解决。

于 2013-05-05T02:02:48.340 回答