All pastes #452753 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-04-22 14:17 UTC
rendered paste body
public class Airline {
	public static void main( String args[ ] ) {
			
			Flugzeug a = new Flugzeug(1234, "HKohl", 200.0, 999.99);
			Flugzeug b = new Flugzeug(23421, "GSchroeder", 29,0);
			Flugzeug c = new Flugzeug();
				
	}
}

class Flugzeug {
	//Einzelne Flugzeugvariablen
	int seriennr;
	String name;
	double spannweite;
	double flugkm;
	
	//Konstruktor
	Flugzeug() {
	}
	
	Flugzeug(int A, String B, double C, double D) {
		this.seriennr = A;
		this.name = B;
		this.spannweite = C;
		this.flugkm = D;
	}
	
	//Methoden
	public double gehtSpannweite() {
		return spannweite;
	}
	public double getFlugKm() {
		return flugkm;
	}
	public String getName() {
		return name;
	}
	public void setFlugKm(double km){
		this.flugkm = km;
	}
	public void fliege(double km){
		this.flugkm = this.flugkm + km;
	}
	
	
}