Hey everybody, I already know like all those main codes but lately I just wanted to learn a few more detailed and stronger codes so since Greenfoot is using Java as a language I googled how to create files in Java and it gave me this:
it is supposed to make a .txt file but Greenfoot tells me it doesn't know the command PrintWriter (or it at least shows me there is an error) so why doesn't it work? How to fix it?
Is there a way of making new files using Greenfoot? Cuz I dont know how to use Eclipse yet...
If yes how?
PrintWriter writer = new PrintWriter("New-File.txt", "UTF-8"); writer.println("The first line"); writer.println("The second line"); writer.close();