Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

1. Speak plainly and briefly, and avoid jargon.

Answered: 1 week ago

Question

How to find if any no. is divisble by 4 or not ?

Answered: 1 week ago

Question

Explain the Pascals Law ?

Answered: 1 week ago

Question

What are the objectives of performance appraisal ?

Answered: 1 week ago