when i try to declare a static variable inside a static method it shows an error as illegal start of expression. is it legal to do so
public class Test { static int zee=5; public static int amethod(){ static int zoo=7; int x =1; return x; } public static void main(String argv[]) { System.out.println("I love Zamples and J2SE 6!"); int y= amethod(); System.out.println(y); Test z = new Test(); System.out.println(zee); }
Test.java:7: illegal start of expression static int zoo=7; ^ 1 error