Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java netbeans 1. Create a class Employee name, salary default constructor overloaded constructor .toString Method 2. Create second class Department name, array of employee class

image text in transcribedjava netbeans

1. Create a class Employee name, salary default constructor overloaded constructor .toString Method 2. Create second class Department name, array of employee class type, count default constructor overloaded constructor addEmployee(name, salary) method 3. Create third class Test main create object of department class call addEmployee method and add 5 employees by giving name and salary value Print all the employee details using loop Task# 2 In the previous program add one more static integer variable in Department class called MAX = 10 In default construcor of Department class apart from setting the department name create an of Employee object and set the lenght of array to MAX In the AddEmployee method of Department class check whether the array of Employee object array is full or not. If it is full display a message called 'Class is full', otherwise add the Employee to the array In the Department class also add toString method that will display all the employees details present in the Employee array object In the test class create an object of Department class Using addEmployee method add 10 Employee Also check whether it is adding 11 employee or not Finally display the all the added employee details by calling toString method

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_2

Step: 3

blur-text-image_3

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

101 Database Exercises Text Workbook

Authors: McGraw-Hill

2nd Edition

0028007484, 978-0028007489

More Books

Students also viewed these Databases questions