当我尝试运行此代码时:
public class Main
{
public static void main(String[] args)
{
Employee employee1 = new Employee("John", 5545, "R&D", "QA Lead", 50000);
}
}
我收到一条错误消息,提示“错误:找不到符号”
我要运行的Employee类代码:
public class Employee
{
private int ID;
private double salary;
private String name, department, designation;
public Employee(){}
public Employee(String userName, int userID, String userDepartment, String userDesignation, double userSalary)
{
name = userName;
ID = userID;
department = userDepartment;
designation = userDesignation;
salary = userSalary;
}
Employee类为后缀中的所有变量提供了各种设置方法和获取方法。