Question: Supposedly the user will enter their "ID #: 1203103" then after that it will automatically create a text file named 1203103.txt How can I do that? Here is my code. what will I change in my code?

```
String id = scan.nextLine();
File file = new File(id.txt);
FileWriter fileWrite = new FileWriter(file);
BufferedWriter bufferedWriter = new BufferedWriter(fileWrite);

```

Answer: 
You need to create a `String` for the file name with the expected format. To do this, you can simply use the `+` operator which concatenates `String`s (and automatically converts non-Strings to Strings):

```
String filename = id + ".txt";

```
This is a different approach by using [try with resource](http://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html)

```
String id = scan.nextLine();
try(BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(new File(id + ".txt")))
{
}
catch(Exception e)
{
}

```