daily pastebin goal
28%
SHARE
TWEET

Untitled

a guest Jan 17th, 2019 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public interface Impresora{
  2.  
  3.     String direccionIp;
  4.     int puerto;
  5.  
  6.     public abstract imprimir();
  7.  
  8.     public abstract escanear();
  9.  
  10.     public abstract copiar();    
  11.  
  12. }
  13.    
  14. public class Canon extends Impresora{ //implementación }
  15.  
  16. public class Epson extends Impresora{ //implementación }
  17.  
  18. public class Samsung extends Impresora{  //implementacion  }
  19.    
  20. import Impresora;
  21.  
  22. public static void main(String args[]){
  23.  
  24.     Impresora impresora1 = new Canon();
  25.  
  26.     impresora1.imprimir(); //De esta manera usas el imprimir de Canon.      
  27.  
  28.  
  29. }
  30.    
  31. public interface Idioma {
  32.    public void saludar();
  33. }
  34. public class Italiano implements Idioma {
  35.    @Override
  36.    public void saludar() {
  37.        System.out.println("Chao");
  38.    }
  39. }
  40. public class English implements idioma {
  41.    @Override
  42.    public void saludar() {
  43.       System.out.println("Hello");
  44.    }
  45. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top