This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
So i am doing a project in which i'm doing the following....
Modify the Movies program so that it keeps the DVDs sorted by director. In order to produce efficient code do not apply sorting to keep the DVDs sorted. Redesign method add instead, so that it inserts the DVD into a sorted collection and produces sorted collection. In addition, implement an efficient method to search for given DVD by the director. Method should be called searchForDVD. It should have only String type formal parameter that provides the director that we are searching for. The return type should be an integer that specifies the index in the array where the DVD is located. When search is not successful method returns -1. Method searchForDVD should be in the DVD collection class. Modify main method so that at the end it also tests method searchForDVD by performing one successful and one unsuccessful search. Display the DVD found in successful search, and write an appropriate comment otherwise.
PROGRAM RUN outline:
Display all DVDs
Add two more DVDs
Display all DVDs after adding those two DVDs
Search for specific DVD that is in the collection and display it
Search for specific DVD that is not in the collection
Here's the code i have so far. it compiles but fails to run due to... java.lang.NullPointerException at java.util.Arrays.binarySearch0(Arrays.java:2439) at java.util.Arrays.binarySearch(Arrays.java:2379) at DVDCollection.addDVD(DVDCollection.java:17) at Movies.main(Movies.java:9)
what am i doing wrong? I've seriously been posting on chegg and everywhere and no one seems to know :/ http://pastebin.com/wrxL2fhN
Subreddit
Post Details
- Posted
- 8 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/javahelp/co...