News

You could avoid the “lack of type safety” and “not enough information” problems by using java.lang.String constants. For example, you might specify static final String DIR_NORTH = "NORTH";.
The compiler will report illegal forward reference when it encounters static int x = y;. This is because source code is compiled from the top down, and the compiler hasn’t yet seen y.
In Java, you can have a section of code inside a class definition that looks like this:code: static { // statements go here }and the statements will be executed when the class is loaded (sort of ...