Skip to content

Instantly share code, notes, and snippets.

@BMU-Verlag
Created August 11, 2020 09:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BMU-Verlag/2af03493d1c4819b2197ccb82a50e3c6 to your computer and use it in GitHub Desktop.
Save BMU-Verlag/2af03493d1c4819b2197ccb82a50e3c6 to your computer and use it in GitHub Desktop.
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