package oop.Verebung;

public class Mitarbeiter {
	
	private String name;
	
	
	
	public Mitarbeiter(String name) {
		super();
		this.name = name;
	}

	public String getName() {
		return name;
	}

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

	public void printName() {
		System.out.println("Mitarbeiter: " + name);
	}
	
	public static void main(String[] args) {
		Mitarbeiter m1 = new Manager("obai");
		m1.printName();
		Manager m;
		if (m1 instanceof Manager) {
			m = (Manager) m1;
			m1.printName();
		}
			
	}
}

class Manager extends Mitarbeiter{

	public Manager(String name) {
		super(name);
	}
	
	@Override
	public void printName() {	
		System.out.println("Manager" + super.getName());
		
	}
	
	
	
}
