Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Q8. Write a declaration of a private field named department that can hold an ArrayList. The elements of the ArrayList are of type Employee. Write
Q8. Write a declaration of a private field named department that can hold an ArrayList. The elements of the ArrayList are of type Employee. Write an assignment to the department variable to create an appropriate ArrayList object.
Q9. (A) If a collection stores 10 objects, what value would be returned from a call to its size method? (B) Write a method call using get to return the fifth object stored in a collection called department.
Q10. Write a method call to add the object held in the variable employee1 to a collection department files.
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