Ask Question
22 June, 00:36

Write the definition of a class employee base on the modular specification:. A data member for Id of type int (private). A data member for EmpName of type string (private). A data member for Salary of type double (private). A method to display the fields Id, EmpName, and Salary.

+1
Answers (1)
  1. 22 June, 04:10
    0
    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
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Write the definition of a class employee base on the modular specification:. A data member for Id of type int (private). A data member for ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers