public static Answer create(File file) throws java.io.FileNotFoundException { Answer a = new Answer(); // Read file into string System.out.println("File to be read: " + file.getAbsolutePath()); a.text = new Scanner(file).useDelimiter("\\Z").next(); return a; }
public static Answer create(String text) { Answer a = new Answer(); a.text = text; return a; }