Created
August 11, 2020 09:08
-
-
Save BMU-Verlag/2af03493d1c4819b2197ccb82a50e3c6 to your computer and use it in GitHub Desktop.
This file contains 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
import java.util.*; | |
public class Gebrauchtwagen implements Fahrzeug, Artikel { | |
private int kilometerstand; | |
private String marke; | |
private String modell; | |
ArrayList<String> beschaedigungen = new ArrayList<>(); | |
private int preis; | |
public Gebrauchtwagen (int kilometerstand, String marke, String modell, int preis){ | |
this.kilometerstand = kilometerstand; | |
this.marke = marke; | |
this.modell = modell; | |
this.preis = preis; | |
} | |
public int kilometerstandAusgeben(){ | |
return this.kilometerstand; | |
} | |
public String markeAusgeben(){ | |
return this.marke; | |
} | |
public String modellAusgeben(){ | |
return this.modell; | |
} | |
public void beschaedigungenEintragen(String beschaedigung){ | |
this.beschaedigungen.add(beschaedigung); | |
} | |
public int preisAusgeben(){ | |
return this.preis; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment