내 응용 프로그램의 main 메소드에서 employee 클래스의 객체를 만들려고합니다. 그러나 변수 이름 lastName firstName 또는 salary를 찾을 수 없으며 이것이 내 성명이 무엇인지 알 수 없습니다.객체 생성시 문제가 발생했습니다.
나는 그것의 실행 여부 인터페이스를 표시해야하지만, 내가 할 경우 내가 그들을 포함하는 내 게시물을 편집 있을지 확실하지 않다package javaapplication14;
public class Employee implements DepartmentConstants, Displayable
{
private int department;
private String firstName;
private String lastName;
private double salary;
public Employee(int department, String lastName, String firstName,
double salary)
{
this.department = department;
this.lastName = lastName;
this.firstName = firstName;
this.salary = salary;
}
@Override
public String getDisplayText()
{
String displayText = firstName + lastName + salary + department ;
return displayText;
}
}
처럼
Employee employee = new Employee(department, lastName, firstName, salary);
직원 클래스 보인다. 주요 방법은 내 응용 프로그램의 주요 방법으로 직원 클래스의 객체를 만들려고 해요하지만이 변수를 찾을 수 없습니다
package javaapplication14;
public class DisplayableTestApp
{
public static void main(String args[])
{
System.out.println("Welcome to the Displayable Test application\n");
// create an Employee object
Employee employee = new Employee(department, lastName, firstName, salary);
// display the employee information
String displayTextEmployee = employee.getDisplayText();
System.out.println(displayTextEmployee);
// create a Product object
Product product = new Product();
// display the product information
String displayText = product.getDisplayText();
System.out.println(displayText);
}
}
주요 방법을 보여준다. –
나는 그것을 내 게시물에 편집했습니다. –