Thread: Issue
View Single Post
  #4 (permalink)  
Old 11-28-2009, 12:16 AM
Fubarable's Avatar
Fubarable Fubarable is online now
Moderator
 
Join Date: Jun 2008
Posts: 6,431
Rep Power: 8
Fubarable is on a distinguished road
Default
On quick glance at your code, I see that you have methods with parameters that are never used.

For instance if you declare a method like so:
Code:
public void load(String pirateTxt) throws IOException {

Then you don't want to hard-code the file name within the method like so:
Code:
Scanner infile = new Scanner(new InputStreamReader(new FileInputStream("pirate.txt")));

If you do this, why even bother giving the method a parameter. Instead, use the parameter:
Code:
Scanner infile = new Scanner(new InputStreamReader(new FileInputStream(pirateTxt)));
Otherwise if you still have problems, you should do some debugging to find out more.
__________________
When posting code, please use code tags so that your code is readable. To do this, place the tag [code] before your block of code and [/code] after your block of code.
How to use Code Tags
Reply With Quote