Write in console and then write to file

Hi, I have a problem with writing to a file in Java. The thing is that if I use the command "story" in the console there will appear a few questions like "What is your name?" etc., and I'll be able to write my name in the console. Once the rest of the questions are answered, the summary of the so called story will simply appear as output in the console.

But now I want to add an argument to the command "story", and there's the problem. In other words, if you write for ex. "story out.txt" (instead of just "story") I want the program to simply repeat the questions, but now I want the summary of the story to be written to the file out.txt, but I can't make it work. In one part I use a class named MakeStory including this code:

Code:

public class MakeStory {
// Name of character
public static String name = "Eva";
// Title of character
public static String title = "the Teacher";
// Description of appearance
public static String appearance = "sporty";
// Various attributes of the character
public static boolean magic_bag = false;
public static boolean happy = true;
public static boolean secret = false;
public static String generate() {
StringBuilder story = new StringBuilder();
story.append("This is the story of ");
story.append(name + ", " + title + ". ");
story.append("Ever since the day " + name + " was born, ");
story.append(name + " looked " + appearance + ".\n\n");
if (magic_bag)
story.append(name + " had a magic bag. ");
if (happy)
story.append(name + " was happy. ");
if (secret)
story.append(name + " had a secret. ");
story.append("\n\nSadly, there is not much else to say about ");
story.append(name + ".");
return story.toString();
}
}

This saves the story to an out.txt file, but now my question is if I want to name the text file to whatever I want, and not just specifically as "out.txt", but as for ex. "hello.txt" etc. How do I do that? :S