Why not just have a class with a method that defines a method and then we use it .
One of the explanations i got in a book was
Java is strongly typed.When making a method call the compiler needs to be able to check that the method actually exists .
then it gave an example:-
//rearrange a[i] and a[j]
The compiler must know that a[i] actually has a compareTo() method .
Now asuuming class did not implement comparable interface but defined a method compareTo() then still the compiler would have been able to know that a[i] has a compareTo() method or not , so again why use interfaces at all ?
and several implementations of this interface which load properties from different sources like XML, DB, file etc. Then in the main (or any other class) you may create the loader and use interface reference to point to it:
After creating you can pass the loader around to any number of methods/classes, and if in some time you decide to load your properties from a DB, all you will need to do is to change one line:
without touching the rest of the code.
Hope this helps.