Last change
on this file since 188 was
188,
checked in by tr, 9 years ago
|
Aufräumarbeiten, Packages für Vorlesung, Übung, Testate FP, weitere Themen
|
File size:
806 bytes
|
Line | |
---|
1 | package eu.hsrw.tr.prog.vl.oop; |
---|
2 | |
---|
3 | public class Student extends Person { |
---|
4 | private static int nextMatNr = 10000; |
---|
5 | private int matnr; |
---|
6 | String fach; |
---|
7 | int jsb; |
---|
8 | |
---|
9 | public Student(String vn, String nn, |
---|
10 | int t, int m, int j, |
---|
11 | String f, int jsb) { |
---|
12 | |
---|
13 | super(vn, nn, t, m, j); |
---|
14 | |
---|
15 | this.fach = f; |
---|
16 | this.jsb = jsb; |
---|
17 | |
---|
18 | this.matnr = Student.nextMatNr; |
---|
19 | Student.nextMatNr++; |
---|
20 | } |
---|
21 | |
---|
22 | /** |
---|
23 | * Copy Konstruktor |
---|
24 | * @param s zu kopierendes Student Objekt |
---|
25 | */ |
---|
26 | public Student(Student s) { |
---|
27 | this.vorname = s.vorname; |
---|
28 | this.name = s.name; |
---|
29 | // Für Objekte muss wiederum deren Copy Konstruktor aufgerufen werden |
---|
30 | this.gebdat = new Datum(s.gebdat); |
---|
31 | this.fach = s.fach; |
---|
32 | this.jsb = s.jsb; |
---|
33 | this.matnr = s.matnr; |
---|
34 | } |
---|
35 | |
---|
36 | public int getMatnr() { |
---|
37 | return matnr; |
---|
38 | } |
---|
39 | |
---|
40 | public int jahrgang() { |
---|
41 | return this.jsb; |
---|
42 | } |
---|
43 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.