&引用;找不到符号“;Java方法定义中的错误
我是计算机科学专业的学生,刚刚开始学习真正的面向对象编程,我假设我的问题与对初始化对象理解不够有关 我的家庭作业必须处理读/写文件的问题,我能处理得很好,如果我能写自己的主要方法,从零开始,我觉得我可以在不到一个小时内完成,但是。。。在家庭作业中,我们上了一堂我们无法改变的主课。他还给了我一个其他的开始方法。详情如下:&引用;找不到符号“;Java方法定义中的错误,java,arrays,oop,object,symbols,Java,Arrays,Oop,Object,Symbols,我是计算机科学专业的学生,刚刚开始学习真正的面向对象编程,我假设我的问题与对初始化对象理解不够有关 我的家庭作业必须处理读/写文件的问题,我能处理得很好,如果我能写自己的主要方法,从零开始,我觉得我可以在不到一个小时内完成,但是。。。在家庭作业中,我们上了一堂我们无法改变的主课。他还给了我一个其他的开始方法。详情如下: import java.io.*; import java.util.*; public class CSCD211Lab1 { private static final in
import java.io.*;
import java.util.*;
public class CSCD211Lab1
{
private static final int TEAMS = 32;
public static void main(String [] args)throws Exception
{
int choice;
Scanner kb = new Scanner(System.in);
Team [] worldCupTeams = null;
worldCupTeams = fillTeamsArray(kb);
do
{
choice = menu(kb);
executeChoice(choice, worldCupTeams);
}while (choice != 8);
}// end main
public static Team [] fillTeamsArray(Scanner kb)throws Exception
{
return null;
}// end fillTeamArray
public static Player [] readPlayers(String filename)throws Exception
{
return null;
}// end readPlayers
public static int menu(Scanner kb)
{
/*
1. Print all Teams to the screen
2. Print all Teams to the User Specified file
3. Sort the Teams by “Natural Order” (Hint: compareTo)
4. Sort the by Team Country Name (Hint: Comparator)
5. Sort each Team's Players by Number (Hint: Player compareTo)
6. Sort each Team's Players by Position (Hint: Comparator)
7. Print a entire team and only that team to a user specified file
8. Quit
*/
return 8;
}// end menu
public static void executeChoice(int choice, Team [] array)throws Exception
{
}// end executeChoice
public static void printArray(PrintStream out, Team [] array)
{
}// end printArray
}// end class
我的问题是,这为什么会导致公共静态团队[]fillTeamsArray出现“找不到符号”错误?我假设我需要在fillTeamsArray中定义它,但每次我尝试时都会得到相同的错误。我不是在找人做作业,我只是在找一个正确的方向。我转学到了这所学校,与我所学的先修课程相当的课程肯定没有涵盖它应该具备的一点内容
感谢您的帮助!
谢谢 您需要导入class
Team
。编译器无法识别团队
。这节课在哪里?在类中导入它CSCD211Lab1
使用intellij之类的IDE,我不知道这是否是一个好的开始方式,但它会让您更容易:
*如果您使用的是默认软件包,则会发出警告。
*不再有导入或拼写错误问题 请向我们显示完整的编译错误消息。
团队
类是否已提供给您?或者你必须写它吗?我想团队
必须由学生来写。那就是要做的事。否则它就不会是面向对象的。