Advertisement
Guest User

Untitled

a guest
Aug 7th, 2008
1,458
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.38 KB | None | 0 0
  1. interface ChatService
  2. {
  3.     public void logout();
  4. }
  5.  
  6. class YahooChat implements ChatService
  7. {
  8.     public void logout()
  9.     {
  10.         //implementation here...
  11.     }
  12.    
  13.     ....
  14. }
  15.  
  16. class MsnChat implements ChatService
  17. {
  18.     public void logout()
  19.     {
  20.         //implementation here
  21.     }
  22. }
  23.  
  24. class SomeClientClass
  25. {
  26.     private ChatService chatservice;
  27.     ...
  28.    
  29.     void logout()
  30.     {
  31.         chatservice.logout();
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement