Interfaces can be used to tell in implementing class that it NEEDS to have those methods implemented. Since java does not support multiple inheritance (ie. extend more than one object) it is usefull to tell something it needs to conform to a certain standard.
Basicly, lets say you create an interface with a single method void called foo(). In interfaces, methods cannot have bodies, so it will look something like:
public interface FooInterface {
public void foo();
}
Then in your class you can do:
public class BarClass implements FooInterface {
}
If you tried to compile something like this it will give you an error, because you need the foo() method.
public class BarClass implements FooInterface {
public void foo() {
// blah
}
}
I use interfaces mostly when i am creating a complicated class/sublass structure, and want all my code to conform to a certain standard.
A plugin system would be an example of using interfaces.