fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. interface Printable{
  6. void print();
  7. }
  8. interface Showable extends Printable{
  9. void show();
  10. }
  11. class TestInterface4 implements Showable{
  12. public void print(){System.out.println("Hello");}
  13. public void show(){System.out.println("Welcome");}
  14.  
  15. public static void main(String args[]){
  16. Printable obj = new TestInterface4();
  17. obj.print();
  18. obj.show();
  19. }
  20. }
Compilation error #stdin compilation error #stdout 0.04s 4386816KB
stdin
Standard input is empty
compilation info
Main.java:18: error: cannot find symbol
obj.show();  
   ^
  symbol:   method show()
  location: variable obj of type Printable
1 error
stdout
Standard output is empty