有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java找不到符号错误Netbeans

大家好,我是Java新手,我正在编写一个简单的程序来模拟跳水比赛。我使用NetBeans,但我不知道为什么它会给我这个错误。 代码如下:

package agoneskataduseon;
import java.util.Scanner;

public class AgonesKataduseon {

 public static void main(String[] args) {
      Scanner input = new Scanner(System.in);
      int numAth, numJud, numDiv;
      System.out.print("Give the number of the athletes in the competition : ");
      numAth = input.nextInt();
      System.out.print("Give the number of the judges : ");
      numJud = input.nextInt();
      System.out.print("Give the numbe rof dives : ");
      numDiv = input.nextInt();
      DivingCompetition game = new Diving Competition(numAth, numJud, numDiv);
  }
}

占卜竞赛课(尚未结束):

import java.util.Scanner;
public class DivingCompetition {
    int numa;
    int numj;
    int numd;
    Athlete[] arr1 = new Athlete[12];
    Athlete[] arr2 = new Athlete[12];

    public DivingCompetition(int numAthletes, int numJudges, int numDives){
        numa = numAthletes;
        numj = numJudges;
        numd = numDives;
    }

    public void readAthletesName(){
        String nam;
        int i=0;
        Scanner input = new Scanner(System.in);
        while(i < numa){
            System.out.print("Give the name of athlete num "+(i+1)+" : ");
            nam = input.nextLine();
            arr1[i] = new Athlete(nam);
            i++;
        }
    }

    public void runCompetition(){
        int i=0;
        Dive dv = new Dive(numj);
        while(i<12){
           arr1[i].addDive(dv);
        }
   }
}

为了记录在案的运动员级别:

public class Athlete {
        String names;
        Dive[] arrayd = new Dive[6]; 
        double fullScore;
        int point;

    public Athlete(String name){
        names = name;
        fullScore = 0;
        point = 0;
    }

    public void addDive(Dive dive){
        arrayd[point] = dive;
        fullScore = fullScore + arrayd[point].computeScore();
        point++;
    }
}

我也会给你上潜水课,但我不认为这样做有什么意义

NetBeans在主函数中给了我一个错误: 找不到符号 符号:班级占卜比赛 地点:AgonesKataduseon

我的问题是为什么它会给我这个错误? 如果我试图制作一个运动员的对象或潜入主功能中,这个问题也会发生


共 (0) 个答案