system_shadowing.invalid.mj 301 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10
/*
 * This should be rejected by a MiniJava compiler like it is by the
 * Java compiler as the class "System" shadows the default System
 * declaration, but cannot have a static field named "out".
 */
class System {
    public static void main(String[] args) {
        System.out.println(42);
    }
}