Answer:
public class Employee {
private int id;
private String empName;
private double salary;
public void displayEmployee(){
System.out.print("Employee ID: " + id + "\nEmployee name: " + empName + "\nSalary: " + salary);
}
}
Explanation:
- Declare the class variables
- Write a method called displayEmployee to display the fields