blooming8

Moto

Mar 4th, 2022 (edited)
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.75 KB | None | 0 0
  1. /**
  2.  *
  3.  * @author alessio
  4.  */
  5. public class Moto extends Veicolo
  6. {
  7.     private int tempi;
  8.     private String tipo;
  9.    
  10.     Moto(int tempi)
  11.     {
  12.         this.tempi = tempi;
  13.         this.tipo = tipo;
  14.     }
  15.    
  16.     @Override
  17.     public String toString()
  18.     {
  19.         return "\nTipo: " + this.tipo + "\nMarca: " + super.marca + "\nAnno: " + super.anno + "\nCilindrata: " + super.cilindrata + "\nTempi: " + this.tempi;
  20.     }
  21.    
  22.     public void setTempi(int tempi)
  23.     {
  24.         this.tempi = tempi;
  25.     }
  26.    
  27.     public int getTempi()
  28.     {
  29.         return this.tempi;
  30.     }
  31.    
  32.     public void setTipo(String tipo)
  33.     {
  34.         this.tipo = tipo;
  35.     }
  36.    
  37.     public String getTipo()
  38.     {
  39.         return this.tipo;
  40.     }
  41. }
  42.  
Add Comment
Please, Sign In to add comment