当我尝试运行这段代码时:
public class Main
{
public static void main(String[] args)
{
Employee employee1 = new Employee("John", 5545, "R&D", "QA Lead", 50000);
}
}
我收到一个错误消息" error : cannot find symbol“
我尝试运行的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类为后缀的所有变量提供了不同的setter和getter。
发布于 2018-09-11 03:17:40
我建议你打开你的项目设置并为源代码重新创建文件夹-定义src目录,以便intellij可以识别。另请参阅this
https://stackoverflow.com/questions/52264018
复制相似问题