public class MainVererbung5{
	public static void main(String[] args){
		Modell m = new Modell(10,20);
		Gmodell g = new Gmodell(2,3,4);
		double a,b,c,f,v, x;

		/*
		In der Klasse MainVererbung5 wird auf die Klasse Modell 
		zugegriffen. 
		Die Zugriffe funktionieren, da die Klassen MainVererbung5 und 
		Modell sich im gleichen package befinden. 
		 */
		a = m.l; 
		b = m.b; 
		c = g.l;  
		f = g.b;
		g.b=7;
		System.out.println(a+" "+b+" "+c+" "+f+" "+g);
	}
}

class Modell{  
	protected double l;
	protected double b;
	
	public Modell(double pl, double pb){
		l = pl;
	    b = pb;
    }

	public double getFlaeche(){
		return(l*b);
	}
};

class Gmodell extends  Modell{  
	private double h;

	public Gmodell(double pl, double pb, double ph){
		super(pl,pb);
		h=ph;
	}

	public double getVolumen(){
		return(b*l*h);
	}
	
	public double getFlaeche(){
		return(2*(h*b+h*l+l*b));
	}
	
}

