Professional Documents
Culture Documents
System.out.println(emps[i].toString());
}
}
public class Point3D {
private double x;
private double y;
private double z;
public Point3D() {
// TODO Auto-generated constructor stub
}
public Point3D(double x, double y, double z) {
super();
this.x = x;
this.y = y;
this.z = z;
}
public double getX() {
return x;
}
public void setX(double x) {
this.x = x;
}
public double getY() {
return y;
}
public void setY(double y) {
this.y = y;
}
public double getZ() {
return z;
}
public void setZ(double z) {
this.z = z;
}
public boolean equals(Point3D p) {
if(this.x==p.x && this.y==p.y && this.z==p.z)
return true;
return false;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
Point3D other = (Point3D) obj;
if(x==other.x && y==other.y && z==other.z)
return true;
return false;
}
@Override
public String toString() {
return "point : x="+x+" y="+y+" z="+z;
}
public Point3D deplacer(double dx, double dy, double dz){
Point3D p=new Point3D();
p.x=this.x+dx;
p.y=y+dy;
p.z=z+dz;
return p;
}
public static void main(String[] args) {
Point3D p1=new Point3D(1, 7, 3);
Point3D p2=new Point3D(1, 2, 3);
System.out.println(p1.equals(p2));
System.out.println(p1.toString());
import java.util.Scanner;
//------------------------------------------------------------------------------
double p=0;
double t=0;
for (int k=0 ; k<tab1.length ; k++)
t+=Math.pow(tab1[k], 2);
p=Math.sqrt(t/n-Math.pow(moy,2));
return p;
}
//-------------------------------------------------------------------------------
//------------------------------------------------------------------------------
int i;
int somme=0;
//------------------------------------------------------------------------------