   java interfaces
  I'm trying to understand the usefulness of Java interfaces. As for as I'm aware of, they are basically like classes, except we don't define their bodies:interface Widget {    void foo(int a, boolean b);    Widget widgClone();}We can then implement the Widget interface via other classes:class Fidget implements Widget {    int x, y, z;    // ...    void foo(int ex, boolean isAlive) {   // ...    }    Widget widgClone() {   // ...    }}To me, this organization just doesn't make sense.  Why wouldn't I just make Widget a superclass to Fidget, and then just overload any of Widget's methods inside of the Fidget class? To me, it seems that it would be more expensive to do this...Obviously I am missing something...what is it??   
  Interfaces define a contract for the implementing classes. So when you implement an interface, the program knows that the implementing class has to define the methods. The reason we would use them is if we know that we want our class to be, say, Serializable, but don't know how the class would go about implementing serialize(). The advantage over deriving from other classes is that you can implement as many interfaces as you want, whereas you can only derive from one superclass. Let me know if you need more explanation/examples.   