I study Java from scratch, there is a question.
Why does this code, which should create an empty text document on the desktop, when trying to compile, gives an error?
package filecreator; import java.io.File; import java.io.IOException; public class FileCreator { public static void main(String[] args) { String fileName = "My File.txt"; String filePath = "/Users/Donrumata/Desktop/"; File myFile = new File(filePath + "/" + fileName); try { myFile.createNewFile(); } catch (IOException e) { e.printStackTrace(); } }