为什么我得到这个错误'.class'?

时间:2013-05-05 01:59:20

标签: java class

我试图创建一个程序,但我得到一些我无法消除的错误。请有人帮我一把吗?

        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);

1 个答案:

答案 0 :(得分:1)

这个声明没有意义:

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

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

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

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