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