create a file and add text java code example Example: java create file File filename = new File(filepath)