0% found this document useful (0 votes)
5 views

Code Java

Uploaded by

farahbenfradj9
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Code Java

Uploaded by

farahbenfradj9
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

public interface Dessinable {

public void dessiner ( );


public void effacer ( );
}
abstract public class Figure implements Dessinable {
protected String couleur;
protected String getCouleur ( ) { return couleur; }
protected void setCouleur ( String c ) { couleur = c; }
}
public class Point {
private float x;
private float y;
public float getX ( ) { return x; }
public float getY ( ) { return y; }
public void Point ( float x, float y) { }
}
public class Cercle extends Figure {
private float rayon;
private Point centre;
public Cercle ( Point centre, float rayon) { ... }
public void dessiner ( ) { ... }
public void effacer ( ) { ... }
}
public class Rectangle extends Figure {
protected Point sommets[] = new Point[2];
public Rectangle ( Point p1, Point p2) { ... }
public void dessiner ( ) { ... }
public void effacer ( ) { ... }
}
public class Losange extends Figure {
protected Point sommets[] = new Point[2];
public Losange ( Point p1, Point p2) { ... }
public void dessiner ( ) { ... }
public void effacer ( ) { ... }
}

You might also like