Not quite true that you can't instantiate an abstract class or an interface. You can't instantiate them directly, but you can use them, to create anonymous classes. Example. Runnable is an interface in java.lang which has one method called . . . void run().
You will see several instances in the Swing part of the
Java tutorials where they start their application like this:-
To instantiate an interface you have to give it a class body with (){} and implement all its methods inside the {}.
Because you implement its methods that is why you say
public class Foo implements BarInterface.