You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Course course1 = new Course("Data Structure");
course1.addStudent("Peter Jones");
course1.addStudent("Kim Smith");
course1.addStudent("Anne Kennedy");
course1.addStudent("Steve Boss");
System.out.println("Nmuber of students in course1: " + course1.getNumberOfStudents());
String[] students = course1.getStudents();
for (int i = 0; i < course1.getNumberOfStudents(); i++) {
System.out.print(students[i] + ", ");
}
System.out.println();
course1.dropStudent("Peter Jones");
for (int i = 0; i < course1.getNumberOfStudents(); i++) {
System.out.print(students[i] + ", ");
}
output:
Nmuber of students in course1: 4
Peter Jones, Kim Smith, Anne Kennedy, Steve Boss,
Peter Jones, Kim Smith, Anne Kennedy, .......
dropstudent always remove last element not specified student. what is solve this bug?
please don't use this library import org.apache.commons.lang3.ArrayUtils;
The text was updated successfully, but these errors were encountered:
output:
Nmuber of students in course1: 4
Peter Jones, Kim Smith, Anne Kennedy, Steve Boss,
Peter Jones, Kim Smith, Anne Kennedy, .......
dropstudent always remove last element not specified student. what is solve this bug?
please don't use this library import org.apache.commons.lang3.ArrayUtils;
The text was updated successfully, but these errors were encountered: