so i'm working on my CS project in which we need to sort a list of DVD's by director. it'll compile, however when i run it i'm getting a null(in java.util.Arrays) i've called java.text.numberformat and java.util.* is that i forgot to add anything in my imports? thanks friends.
public void addDVD(String title, String director, int year, double cost, boolean bluray)
{
DVD newDvd = new DVD(title, director, year, cost, bluray);
int index = Arrays.binarySearch(collection, newDvd);
if(index >= 0) {
System.out.println("DVD with title " + newDvd.getTitle() + " already exists.");
}
else {
int index1 = -index - 1;
collection = insertDVD(collection, newDvd, index1);
System.out.println("DVD with title " + newDvd.getTitle() + " added.");
}
totalCost += cost;
}