- Notifications
You must be signed in to change notification settings - Fork870
Open
Description
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;
Metadata
Metadata
Assignees
Labels
No labels