import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
public class StringToFile {
public static void main(String[] args) throws IOException {
String msg = "hello";
Files.write(Paths.get("./duke.txt"), msg.getBytes());
}
}