Question: Code in java, please 1. Write a generic Bag class using an array to store any objects. Test the Bag class with a Demo class

Code in java, please

1. Write a generic Bag class using an array to store any objects. Test the Bag class with a Demo class to store, find, delete, and display objects of Integers and String, respectively.

2. Write another class called Student, which contains name (String), id (String), and gpa (double) fields. Modify the generic Bag class from the previous problem to store five students with automatically generated id numbers. You will then find, delete, and display any student by his/her id number.

3. Write another class called Faculty, which contains name, id, and salary fields. Modify the generic Bag class from the previous problems, if necessary, to store five faculty and five students, and then find, delete, and display either faculty or student by id number. All id numbers should be automatically generated and there should have no duplicated id values between Students and Faculty.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!