How to Create File If Not Exist in Java

How to Create File If Not Exist in Java
ref‮l:ot re‬autturi.com
/**
 * @author lautturi.com
 * Java example: Create File If Not Exist
 */

import java.util.*;
import java.io.File;

public class Lautturi {

	public static void main(String[] args) {
		
		String fileName = "test.txt";

		File file = new File(fileName);

		if(file.exists()) {
				System.out.println("file exists");
		}

	}
}
Created Time:2017-09-22 07:43:59  Author:lautturi