프로그램을 컴파일하려고하는데 이전에 보지 못한 몇 가지 오류가 계속 발생합니다. 내가 얻는 오류는 다음과 같습니다오류가 발생하지만 의미가 확실하지 않습니다.
import java.util.Scanner;
import java.io.FileReader;
import java.io.*;
public class Project1
{
public static void main (String [] args) throws FileNotFoundException
{
Scanner inFile = new Scanner(new FileReader("artists.txt")); //read from file
Scanner console new Scanner(System.in); //read from user input
int sum = 0; //sum of revenue
String artist; //user input
int revenue = 0; //store yearly revenue
System.out.println("Please enter the name of a band/artist: ");
artist = console.next();
String[] tokens = artist.split(" ");
while(inFile.hasNext())
{
if (tokens == inFile.hasNext())
{
if (inFile.Next == (2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012));
{
if (inFile.hasNext())
{
revenue = inFile.nextInt();
sum += revenue;
System.out.print("sum");
}
}
}
}
inFile.close();
: 이것은 내 프로그램입니다
Error: Syntax error, insert ";" to complete LocalVariableDeclarationStatement [Line 13]
Error: Syntax error on token "==", Name expected after this token [Line 30]
사람이, 다른 실수를 참조를 지적 주시기 일어나는 경우
. 고맙습니다.
자바를 배우는 경우 간단한 자바 예제부터 시작해야한다고 생각합니다. 귀하의 코드는 기본적인 구문 오류를 가지고 있습니다 ... –