這裏是我的for循環... jGRASP說,有符合我的for循環中,我看不到問題的行開始一個問題,想一些幫助來解決我的代碼。 ..jGRASP說我的for循環是不正確
公共類DirectoryLookup { 公共靜態無效的主要(字串[] args)拋出IOException異常{
if (args.length == 0) {
System.out.println("Please supply data file");
System.exit(0);
}
else {
System.out.println("Database server is Ready for Number Lookups!");
}
File inputDataFile = new File(args[0]);
Scanner inputFile = new Scanner(inputDataFile)
Scanner input = new Scanner(input.in);
int n = inputFile.nextInt();
int list[] = new int[n];
found = false;
while (Scanner.hasNext()); {
System.out.println("Enter number to check value");
int x = input.nextInt();
for (i = 0, i < n, i++);
if (x == list(i)); {
found = true; break
System.out.println("x is in the list");
else {
System.out.println("x is not in the list");
}
}