All pastes #219562 Raw Edit

Something

public java v1 · immutable
#219562 ·published 2006-10-24 19:20 UTC
rendered paste body
public class Wohnung{	private double flaecheInnen;	private double flaecheBalkon;	public Wohnung(double innen, double balkon){		this.setInnen(innen);		this.setBalkon(balkon);	}	public Wohnung(){		this(100.0, 10.0);	}	public void setInnen(double innen){		this.flaecheInnen = innen;	}	public double getInnen(){		return this.flaecheInnen;	}	public void setBalkon(double balkon){		this.flaecheBalkon = balkon;	}	public double getBalkon(){		return this.flaecheBalkon;	}	public double getGesamt(){		return this.getInnen() + this.getBalkon() / 2;	}	public String toString(){		String result = "";		result = "Wohnung\n";		result = result + "\tInnenraum: " + this.getInnen() + "\n";		result = result + "\tBalkon: " + this.getBalkon() + "\n";		result = result + "\tGesamt: " + this.getGesamt() + "\n";		return result;	}}class Start{	public static void main (String[] args) {		Wohnung w1 = new Wohnung(40.0, 10.0);		Wohnung w2 = new Wohnung(80.0, 15.0);		System.out.println(w1.toString());		System.out.println(w2.toString());		System.out.println(w1.getGesamt() + w2.getGesamt());	}}