Ask Question
20 September, 01:19

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.

+5
Answers (1)
  1. 20 September, 03:00
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers