28 novembre 2008
Tableaux dynamiques
Déclaration :
private ArrayList<Photos> albumPhoto;
Initialisation :
public void init()
{
this.albumPhoto = new ArrayList<Photos>();
int i = 0;
String rep = "n";
do
{
Photo p = new Photo();
p.init();
this.albumPhoto.add(p);
rep = Console.readString("Voulez vous ajouter une autre photo ?");
}
while(rep.toLowerCase().equals("o");
}
Publicité
Commentaires