See Variables (The Java™ Tutorials > Learning the Java Language > Language Basics)
The variable n is out of scope outside the main method, so you cannot reference it from another method. That being...