Answered step by step
Verified Expert Solution
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
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 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 methodStep 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