I need to make a method which deletes all objects in an array of objects that have the variable grade=1 and return the "resized" array of objects.
the objects looks like this:
public class Exam {
private Course course; // Course is a class
private Student student; // Student is a class
private Integer grade;
private LocalDateTime date; }
public class Student{
private String id;
private LocalDate birthDate; }
public class Course {
private String id;
private String name;
private Integer ECTS;
private Profesor subjectBearer;
private Student[] student;}
the method needs to look something like this:
private Exam[] filterPassedExams(Exam[] exams) { ...}
any help or advice on how to solve the problem without using the lists would be awesome [on the course we didn't learn list yet so we can't really use them (But I would like to know that solution also if its faster for the future usage)].