Source Code : This shows that a class implementing an interface need not

Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com. Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com. Click Here or search from google with Libraries Name you get jar file related it

This shows that a class implementing an interface need not


import java.io.*;

/** This shows that a class implementing an interface need not
 * declare all the Throws that are declared in the interface.
 */
public class InterfaceWithoutAllThrows {
  interface bar {
    public void foo() throws IOException;
  }
  class baz implements bar {
    public void foo() {
      System.out.println("This is foo-lish");
    }
  }
  public static void main(String[] argv) {
    new InterfaceWithoutAllThrows().new baz().foo();
  }
}


           
       

Thank with us