When the following java code is executed in eclipse, it gives the correct output (i.e. prints \'Class B\'), but according to java specification, the code cannot be compiled (sin
Eclipse uses its own Java compiler (called ecj) instead of javac. This compiler allows (partial) compilation of broken source files.
ecj
javac