bugfix
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
package Sorting;
|
package Sorting;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.lang.Integer;
|
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
@@ -12,11 +11,15 @@ public class RandomWordFileReader {
|
|||||||
private ArrayList<String> words = new ArrayList<String>();
|
private ArrayList<String> words = new ArrayList<String>();
|
||||||
|
|
||||||
public RandomWordFileReader(String filename){
|
public RandomWordFileReader(String filename){
|
||||||
try(BufferedReader reader = Files.newBufferedReader(Path.of(file));){
|
try(BufferedReader reader = Files.newBufferedReader(Path.of(filename));){
|
||||||
reader.lines().forEach(word -> words.add(word));
|
reader.lines().forEach(word -> words.add(word));
|
||||||
}catch (IOException ex){
|
}catch (IOException ex){
|
||||||
System.err.println(ex);
|
System.err.println(ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getWords(){
|
||||||
|
return words;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user