klassen in java
Download
Skip this Video
Download Presentation
Klassen in Java

Loading in 2 Seconds...

play fullscreen
1 / 7

Klassen in Java - PowerPoint PPT Presentation


  • 67 Views
  • Uploaded on

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;

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Klassen in Java' - salaam


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
ablauf
Ablauf
  • Klassenaufbau
  • Vererbung
  • Assoziation
  • Aggregation
  • Komposition

97wi21 Klassen in Java

klassenaufbau
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

vererbung
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

assoziation
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

aggregation
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

komposition
Rechnung

Position

...

...

...

...

Komposition

class Rechnung {

...

class Position {

...

}

}

97wi21 Klassen in Java

ad