package xml2;

import java.io.*;  // Exception

public class Person implements Serializable {

   // private static final long serialVersionUID = 20080330L;

    private String firstname;
    private String lastname;
    private String password;
    private Gehalt gehalt;  // ist Klasse


    public Person() {
        this.firstname = "";
        this.lastname = "";
        this.password = "";
        gehalt = new Gehalt(0);
    }

    public Person(String firstName, String lastName, String password, double betrag) {
        this.firstname = firstName;
        this.lastname = lastName;
        this.password = password;
        gehalt = new Gehalt(betrag);
    }

    public String toString() {
       return new String(" "+lastname + ", " + firstname+ "\n Passwort: " + password+" Gehalt:" +gehalt);
    }

    public void setFirstname(String firstName) {
      this.firstname = firstname;
      System.out.println("firstname: "+firstname);
    }
    public void setLastname(String lastName) {
      this.lastname = lastname;
    }
    public void setPassword(String password) {
      this.password = password;
    }
    public void  setBetrag(double betrag) {
      gehalt.setBetrag(betrag);
    }


    public String getFirstname() {
      return  firstname;
    }
    public String getLastname() {
      return  lastname;
    }
    public String getPassword() {
      return  password;
    }

    public double getBetrag() {
      return gehalt.getBetrag();
    }


}  // Person

