Given the following program:
class A {
static int java = 42;
static int System = -1;
public static void main(String[] args) {
java.lang.System.out.println("Foo");
}
}
Compiling this gives me an error saying that "int cannot be dereferenced." The reason is obvious, but how to handle such situations. This is especially true in code generation scenarios where it is impossible to know which user code is interwoven with the generated code.
In C #, I would just use the namespace specifier "global ::" to "java.lang", but what do you do in Java?
source
share