java create file

Java
File filename = new File(filepath)String fileData = "yourContent";
FileOutputStream fos = new FileOutputStream("yourFile.txt");
fos.write(fileData.getBytes());
fos.flush();
fos.close();
Source

Also in Java: