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 shouldn't do that. It leads to ambiguous results. If a class couldn't be compiled, then its corresponding .class file should be removed.
If you check the bin folder, B.class and A.class are present. Not sure why it creates B.class even though B doesn't compile