CCB Premier Import

This commit is contained in:
Christian Cunat-Brulé
2018-07-23 10:52:48 +02:00
commit f55475a23f
765 changed files with 209793 additions and 0 deletions

30
03-SOURCES/Cercle.java Normal file
View File

@@ -0,0 +1,30 @@
class Cercle
{ class Centre // d<>finition interne a Cercle
{ public Centre (int x, int y)
{ this.x = x ; this.y = y ;
}
public void affiche()
{ System.out.println (x + ", " + y) ;
}
class CentreCentre {
}
private int x, y ;
}
public Cercle (int x, int y, double r)
{ c = new Centre (x, y) ;
this.r = r ;
}
public void affiche ()
{ System.out.print ("cercle de rayon " + r + " de centre ") ;
c.affiche() ;
}
public void deplace (int dx, int dy)
{ c.x += dx ; c.y += dy ; // ici, on a bien acces <20> x et y
}
private Centre c ;
private double r ;
}