Are you talking about in a scenario on the gallery, to save high scores and the like? If so it's not something that can be done at present. It has been talked about in the past, but as far as I know it's not something that anyone is looking at at the moment.
You should really be much more specific with your questions generally - even though you've now said "in Greenfoot", do you mean saving a file programmatically from a scenario? Saving the scenario to disk? Saving a particular source file in a scenario to disk?
If you phrased your questions more specifically and less ambiguously to start with you'd find what you wanted to much quicker!
@kiarocks, the java (oracle) site Basic I/O has all the information you need to Open, Read, Write, and Create files in Java. For an example look at my Fractal Fun scenario (with-source) that saves image files. Look in the 'Graph' (World) class and the final method is the 'saveImage()' method.