Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Q2. Write the definition of a class that has the following properties: [01][2.5 Marks] a. The name of the class is Employee. b. The class
Q2. Write the definition of a class that has the following properties: [01][2.5 Marks] a. The name of the class is Employee. b. The class Employee has four instance variables: empName of type String, emaid of type int and empDep of type String. c. The class Employee has the following methods: 1. toStringto return the data stored in the data members with the appropriate titles as a string 2. setName method to set the empName 3. setId-method to set the empld 4. getDep-value-returning method to return the empDep 5. default constructorthe default value of empName and empDep, as empty string , value of empId as 0. !! 6. constructor with parameterssets the values of the instance variables with the parameter values specified by the user 1
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started