1 / 7

Klassen in Java

Klassen in Java. Ablauf. Klassenaufbau Vererbung Assoziation Aggregation Komposition. Person. # name : String + setName (wert : String) : void + getName (void) : String. Klassenaufbau. class Person { protected String name; public void setName(String wert) { this.name = wert;

salaam
Download Presentation

Klassen in Java

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Klassen in Java

  2. Ablauf • Klassenaufbau • Vererbung • Assoziation • Aggregation • Komposition 97wi21 Klassen in Java

  3. Person # name : String + setName (wert : String) : void + getName (void) : String Klassenaufbau class Person { protected String name; public void setName(String wert) { this.name = wert; } public String getName(void) { return this.name; } } 97wi21 Klassen in Java

  4. Person # name : String + setName (wert : String) : void + getName (void) : String Mitarbeiter # maNr : int + setmaNr (wert : int) : void + getmaNr (void) : int Vererbung class Mitarbeiter extends Person { protected int maNr; public void setmaNr(int wert) { this.maNr = wert; } public int getmaNr(void) { return this.maNr; } } 97wi21 Klassen in Java

  5. Mitarbeiter # maNr : int # abt : Abteilung + setmaNr (wert : int) : void + getmaNr (void) : int + setAbteilung (wert : Abteilung) : void + getAbteilung (void) : Abteilung Abteilung ... ... Assoziation class Mitarbeiter extends Person { protected int maNr; protected Abteilung abt; public void setmaNr(int wert) { this.maNr = wert; } public int getmaNr(void) { return this.maNr; } public void setAbteilung(Abteilung wert) { this.abt = wert; } public Abteilung getAbteilung(void) { return this.abt; } } 1, * arbeitet in 1, 1 97wi21 Klassen in Java

  6. Abteilung # name : String + mitarbeiter : List + setName (wert : String) : void + getName (void) : String Mitarbeiter ... ... Aggregation class Abteilung { protected String name; public List mitarbeiter; public void setName(String wert) { this.name = wert; } public String getName(void) { return this.name; } } 1, 1 beinhaltet 1, * 97wi21 Klassen in Java

  7. Rechnung Position ... ... ... ... Komposition class Rechnung { ... class Position { ... } } 97wi21 Klassen in Java

More Related