If you have access to the implementation at compile time : no problem.
(Your jars must only be in your classpath.)
Otherwise, one way to do this is :
Thre's a lot of examples in
Java :
JDBC Drivers (interface is part of Java API, implementations are DB Vendors API...), a lot of
J2EE things (
servlets, JMS, etc.)