(Enable the Course class cloneable) Rewrite the Course class in Listing 10.6 to add a clone method to perform a deep copy on the students field. 3.9


Please help


(Enable the Course class cloneable) Rewrite the Course class in Listing 10.6 to<br>add a clone method to perform a deep copy on the students field.<br>3.9<br>

Extracted text: (Enable the Course class cloneable) Rewrite the Course class in Listing 10.6 to add a clone method to perform a deep copy on the students field. 3.9
LISTING 10.6 Course.java<br>1 public class Course {<br>private String courseName;<br>private String[] students = new String[100];<br>private int number0fStudents;<br>public Course(String courseName) {<br>this.courseName = courseName;<br>}<br>8<br>9.<br>public void addStudent (String student) {<br>students [number0fStudents]<br>number0fStudents++;<br>10<br>11<br>= student ;<br>12<br>13<br>14<br>public String [] getStudents () {<br>return students;<br>15<br>16<br>17<br>18<br>19<br>public int getNumber0fStudents ()<br>return number0fStudents;<br>20<br>21<br>22<br>23<br>public String getCourseName () {<br>return courseName;<br>24<br>25<br>26<br>27<br>28<br>public void dropStudent (String student) {<br>// Left as an exercise in Programming Exercise 10.9<br>29<br>30 )<br>

Extracted text: LISTING 10.6 Course.java 1 public class Course { private String courseName; private String[] students = new String[100]; private int number0fStudents; public Course(String courseName) { this.courseName = courseName; } 8 9. public void addStudent (String student) { students [number0fStudents] number0fStudents++; 10 11 = student ; 12 13 14 public String [] getStudents () { return students; 15 16 17 18 19 public int getNumber0fStudents () return number0fStudents; 20 21 22 23 public String getCourseName () { return courseName; 24 25 26 27 28 public void dropStudent (String student) { // Left as an exercise in Programming Exercise 10.9 29 30 )

Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here