Advertisement
Guest User

Untitled

a guest
Jul 19th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.38 KB | None | 0 0
  1. public class Auto extends Veicolo {
  2.    
  3.     private boolean compatta;
  4.  
  5.     public Auto(String targa, boolean compatta) throws VeicoloException {
  6.         super(targa);
  7.         this.compatta = compatta;
  8.     }
  9.  
  10.     public Auto(String targa) throws VeicoloException {
  11.         this(targa, true);
  12.     }
  13.  
  14.     @Override
  15.     public int getTempoSmaltimento() {
  16.         if (compatta)
  17.             return 1;
  18.         else
  19.             return 3;
  20.        
  21.     }
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement