Revise the Course class as follows: Revise the getStudents() method to return an array whose length
Question:
Revise the Course class as follows:
■ Revise the getStudents() method to return an array whose length is the same as the number of students in the course.
■ The array size is fixed in Listing 10.6. Revise the addStudent method to automatically increase the array size if there is no room to add more students. This is done by creating a new larger array and copying the contents of the current array to it.
■ Implement the dropStudent method.
■ Add a new method named clear() that removes all students from the course.
Test your program using https://liveexample.pearsoncmg.com/test/
Exercise10_09.txt
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Introduction To Java Programming And Data Structures Comprehensive Version
ISBN: 9780136520238
12th Edition
Authors: Y. Daniel Liang
Question Posted: