Hallo zusammen,
bin gerade dabei ein Klasse zuschreiben und bekomme bei folgendem Code, vom Compiler die Meldung "Uses or overrides a depcrecated API"
bin gerade dabei ein Klasse zuschreiben und bekomme bei folgendem Code, vom Compiler die Meldung "Uses or overrides a depcrecated API"
Code:
public class Punkt implements Messobjekt {
private double x,y,z; // Koordinaten
private Punkt(double x, double y, double z){
this.x = x;
this.y = y;
this.z = z;
}
public static Punkt zufallsPunkt(){
return new Punkt(Math.random()*100, Math.random()*100, Math.random()*100);
}
public String toString(){
double x = this.x;
double y = this.y;
double z = this.z;
return "Punkt ("+x+"|"+y+"|"+z+")";
}
public Double abstand (Object obj){
if (obj instanceof Punkt){
Punkt p1 = (Punkt) obj;
double x = Math.sqrt(Math.pow(this.x - p1.x,2)+Math.pow(this.y - p1.y,2) + Math.pow( this.z + p1.z,2));
Double z = new Double(2.1);
return Double.NaN;
}else{
return Double.NaN;
}
}
}