package VorlesungsFolien.Verebung;

public class DynamischeBindung {

	public static void main(String[] args) {
		Parent kind1 = new Kind("Obai",22);
		System.out.println(kind1.print());
	}

}

class Parent{
	private String name;
	private int alter;
	private String adresse;
	
	public Parent(String name, int alter) {
		this.name = name;
		this.alter = alter;
	}
	
	public Parent(String name) {
		this.name = name;
	}
	
	

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}



	public int getAlter() {
		return alter;
	}

	public void setAlter(int alter) {
		this.alter = alter;
	}

	public String print() {
		return "Name: " + name + " Alter: " + alter;
	}
}

class Kind extends Parent{

	public Kind(String name, int alter) {
		super(name, alter);
		System.out.println("Kind klasse");
	}	
}
