Answered step by step
Verified Expert Solution
Question
1 Approved Answer
CodeHS - Teacher Class List Methods JAVA Now that the classList Array has been implemented, we need to create methods to access the list items.
CodeHS Teacher Class List Methods JAVA
Now that the classList Array has been implemented, we need to create methods to access the list items.
Create the following static methods for the Student class:
getLastStudent returns the name of the last student in the classList array.
getClassSize returns the size of the classList
addStudentint index, Student student adds a new student to the classList at index index. This method is a little tricky when the new Student is added to the class, it will create a duplicate value classList because of our Student constructor. This method should also include a command to remove the extra Student in the classList added to the end.
getStudentint index returns the name of a student at the index specified.
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