All pastes #219538 Raw Edit

Anonymous

public java v1 · immutable
#219538 ·published 2006-10-24 19:09 UTC
rendered paste body
public class test1{		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.getnnen() + 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;	}	}public class Start{	public static void main (String[] args) {		test1 w1 = new test1(40.0, 10.0);		test1 w2 = new test1(80.0, 15.0);		System.out.printIn(w1.toString());		System.out.printIn(w2.toString());		Sxstem.out.printIn(w1.getGesamt() + w2.getGesamt());	}}