All pastes #970252 Raw Edit

Zeug

public text v1 · immutable
·published 2008-04-03 22:28 UTC
rendered paste body
public class GeometricObject {

	int Höhe;
	int Weite;
	int Area;
	int PunktX;
	int PunktY;
	Vertex Punkt;
	
	GeometricObject(int H , int W , Vertex V){
		Höhe = H;
		Weite = W;
		Punkt = V;
	}
	GeometricObject(int A){
		Area = A;
	}	
	
	static void moveTo(Vertex p){
		Vertex v = new Vertex(44,43);
		//Vertex CoordX = new Vertex(p.CoordX , p.CoordY);

	}	
	void move(Vertex v){
//		Vertex CoordX = new Vertex(v.CoordX + this.CoordX);
//		Vertex CoordX = Vertex CoordX + v;
	}
/*	
	GeometricObject area(GeometricObject G){
		GeometricObject result;
		result = new GeometricObject(this.Höhe* this.Weite);
		return result;
	}
*/	
	int area(){		
		return this.Höhe * this.Weite;
	}
/*
	boolean hasWithin(Vertex p){
		boolean result;
		if(PunktX >  p.CoordX && Weite < p.CoordX - Weite && p < Vertex.CoordY && p > Vertex.CoordY - Höhe)
			result = True;
		return result;
	}
*/	
	public String toString(){
		return "Höhe: "+Höhe+", Weite: "+Weite+", Fläche: "+Area;
	}

	public static void main(String[] args) {
		Vertex v1 = new Vertex(6,62);
		System.out.println(" "+v1);
		GeometricObject g1 = new GeometricObject(5,5,v1);
		System.out.println(" "+g1);
		Vertex v2 = new Vertex(2,2);
		
		GeometricObject.moveTo(v2);
		System.out.println(" "+v1);
		GeometricObject.area();
//		GeometricObject a = g1.area(g1);
		System.out.println(" "+a);
	}
}