Problems and Solutions

Problems and Solutions

Problem: The insert method just wasn't working. It was just yeah, not even running 
Solution: Silly me forgot to send it to the insert method :P 

Problem: Everything works fine except for the printing out to the file. 
Solution: 

Problem: When I get user input for the file, it assumes the directory hasn't been created yet, and there's a null pointer exception. 
Solution: Supposed to set the boolean to true, but I didn't.

Problem: The program was pulling a null pointer exception every single time I tried to get information form a file.
Solution: The file had an extra line in between entries so the program was reading the wrong line(s) of code.

Problem: The program wouldn't run the Tree Constructor.
Solution: Absolutely no idea. It worked when Ryk tried it, so I copied what he had and it worked...I don't really know how it was solved.

Problem: Whenever I tried to use the outfile print writer, it didn't work because it was not declared.
Solution: I ended up just making the out file a variable in the main class, and it was much easier to handle.

Problem: I didn't know how many times to run the outer for loop in the readFromFile method because it would depend on the number of entries.
Solution: I had to count the number of entires throughout, and increase or decrease the number accordingly.

Problem: The program kept getting a NullPointerException in the insert method.
Solution: I had forgotten to insert the if statement to check whether the tree even existed before trying to do something with it. 

No comments:

Post a Comment