If you compile this code,
you should get the following output:
The compiler explanations are self-explanatory...
- on line 1, there is an ambiguous field access (nothing to do with static) (
JLS 8.3.3.3 Example: Multiply Inherited Fields)
- line 2 is not a statement as pointed out by Ravish (
JLS 14.8 Expression Statements)
- on line 3, we try to assign a value to a final variable. (
JLS 4.5.4 final Variables)
[ July 02, 2002: Message edited by: Valentin Crettaz ]