logo

Crowdly

Aufgabe : Implementieren Sie die Klassen Haus.java, Hundehütte.java und Wohnhaus...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Aufgabe: Implementieren Sie die Klassen Haus.java, Hundehütte.java und Wohnhaus.java entsprechend des dargestellten Klassendiagramms.

public  class Haus {

  private int breite;

  private int länge;

  int anzahl;

  public (int b, int l) {

     this.breite=b;

     this.länge=l;

     anzahl++;

  }

  public int getGrundfläche() {

      this.breite*this.länge;

  }

  public int getAnzahl() {

      return anzahl;

  }

    String getMaterial();

}

 

public class Hundehütte  Haus{

  public Hundehütte(int b, int l) {

    (b, l);

  }

  @Override

  public String () {

    return "Holz";

  }

}

 

public class Wohnhaus  Haus{

   int stockwerke;

  public Wohnhaus(int stockwerke, int b, int l) {

    (b, l);

    .stockwerke=stockwerke;

  }

  @Override

  public String () {

    return "Stein";

  }

}

 
More questions like this

Want instant access to all verified answers on moodle.mm-bbs.de?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!