-1
我在跟隨一個問題,但我得到這個錯誤。我不知道如何解決它,我查了這個錯誤,但我不能把它與我的代碼。希望得到任何幫助!如何解決語法錯誤,插入「... VariableDeclaratorId ...」
import java.util.Scanner;
public class Employee {
private static String name;
private static String job;
private static float salary;
private static int id;
public Employee() {
Scanner scan = new Scanner(System.in);
name = scan.nextLine();
job = scan.nextLine();
salary = scan.nextFloat();
id = scan.nextInt();
}
public Employee(String name, String job, float salary, int id) {
name = name;
job = job;
salary = salary;
id = id;
}
public String getName(name) {
return name;
}
public String getJobTitle(job) {
return job;
}
public float salary(salary){
return salary;
}
public static void showEmp() {
System.out.println("Employee is called: " + name);
System.out.println("They are a " +job);
System.out.println("Their salary is " + salary);
System.out.println("Their Employee ID number is " + id);
}
}
這就解決了,謝謝。 –