/* Declaration de tableaux de variables */ /* de type agrege position en deux dimensions */ public class TableauPosition2D { /* Type agrege de stockage d'une position du plan */ static class Position2D { double x = 0.0; double y = 0.0; }; /* Programme principal */ public static void main(String [] args) { int i; final int TAILLE = 10; /* Declaration du tableau */ Position2D [] tpos = new Position2D[TAILLE]; /* Initialisation des composantes par programme */ for ( i = 0 ; i < TAILLE ; i++ ) tpos[i] = new Position2D(); /* ******************************************** */ for ( i = 0 ; i < tpos.length ; i++ ) Ecran.afficherln(tpos[i].x," ",tpos[i].y); } }