Created
February 7, 2010 07:36
-
-
Save rahulkmr/297286 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Connection | |
| { | |
| /* generic code ; private */ | |
| /* the interface is public */ | |
| public Connection() { | |
| } | |
| public int connectTo() { | |
| } | |
| } | |
| class OracleConnection extends Connection | |
| { | |
| /* implementation specific code ; private */ | |
| /* public interface */ | |
| public OracleConnection() { | |
| } | |
| public int connectTo() { | |
| } | |
| } | |
| class Tester | |
| { | |
| public static void main(String[] a) { | |
| /* coding to the interface */ | |
| Connection c = new OracleConnection(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment