33 lines
621 B
Java
33 lines
621 B
Java
|
|
/**
|
|
* Beschreiben Sie hier die Klasse Datenbank.
|
|
*
|
|
* @author (Ihr Name)
|
|
* @version (eine Versionsnummer oder ein Datum)
|
|
*/
|
|
public class Datenbank
|
|
{
|
|
//Attribute
|
|
private Student[] Studenten;
|
|
private int Anzahl = 0;
|
|
public Datenbank(int max){
|
|
Studenten = new Student [max];
|
|
}
|
|
|
|
//Konstruktor
|
|
public String toString(){
|
|
String result = "";
|
|
for(int i = 0; i<Anzahl; i++){
|
|
result = result + Studenten[i].toString();
|
|
result = result + "\n";
|
|
}
|
|
return result;
|
|
}
|
|
public void addStudent(Student s){
|
|
Studenten[Anzahl] = s;
|
|
Anzahl++;
|
|
}
|
|
|
|
}
|
|
|