static variable and non-static
271944Mar 22 2011 — edited Mar 23 2011I have a quick question. The following syntax compiles.
private String t = key;
private static String key = "key";
But this doesn't compile.
private String t = key;
private String key = "key";
Can anybody explain how it is treated in java compiler?
Thanks.