Hey guys,
I'm a starter so I had a doubt related to placement of a static variable. On line 5, for "static int d=5" compiler issues "illegal start of expression". But when I place it outside main() as Instance variable it works and prints "Hello 5". Why this thing?
public class AbstractClass {
public static void main(String args[]) {
String s = "Hello";
static int d=5;
System.out.println(s);
System.out.println(d);
}
}