Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class App {
- public static void main(String[] args) {
- final Formatter x; // It outputs a string
- try{
- x = new Formatter("Fred.txt");
- // If it doesn't exist, it will automatically create a new file with this name
- System.out.println("You created a file!");
- }
- catch (Exception e){
- System.out.println("You have got an error");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement