fork download
  1. interface Foo {
  2. void bar();
  3. }
  4.  
  5. public class Main {
  6.  
  7. public void bar() { }
  8.  
  9. public static void main (String[] args) {
  10. //class Wrapper extends Main implements Foo{}
  11. Foo broken = (Foo)new Main(){};
  12. //broken.bar();
  13. }
  14. }
Compilation error #stdin compilation error #stdout 0.1s 320576KB
stdin
Standard input is empty
compilation info
Main.java:11: error: incompatible types: <anonymous Main> cannot be converted to Foo
		Foo broken = (Foo)new Main(){};
		                  ^
1 error
stdout
Standard output is empty