I'm willing to bet you're homework assignment asks you to print the numbers to a file, based on the calss name.

If so, see Lesson: Basic I/O (The Java™ Tutorials > Essential Classes) for help