An interface simply means a “public API” of something: it is a contract against which you write software. Java uses the interface keyword to define classes without code containing such contracts.
The bridge pattern is a design pattern. It means a denouement. You could say that Java interfaces are one way to implement this pattern.
Note that bridges usually expose the full API, while Java interfaces can expose only part of the API. Example. You have a Foo class with two methods: bar() and baz() .
A bridge is all that has the same open API as Foo , and which can be used anywhere Foo can be used.
With interfaces, you can have two. One contains bar() , and the other baz() . Any class that implements both versions is a valid version for Foo , but you can also have classes that implement only one of them.
source share