1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| import java.util.ArrayList;
import java.util.List;
public class main {
public static void main(String[] args) {
List<String> nomsGenreCD = new ArrayList<String>();
nomsGenreCD.add("Classiques");
nomsGenreCD.add("Pop-Rock");
List<String> nomsGenreLivre = new ArrayList<String>();
nomsGenreLivre.add("BD");
nomsGenreLivre.add("Roman");
List<String> nomsGenreDVD = new ArrayList<String>();
nomsGenreDVD.add("Thriller");
nomsGenreDVD.add("S-F");
Categorie catLivre = new Categorie("Livres",new Genres(nomsGenreLivre));
Categorie catCD = new Categorie("CD",new Genres(nomsGenreCD));
Categorie catDVD = new Categorie("DVD",new Genres(nomsGenreDVD));
System.out.println(catLivre.getNomCat() + ": " + catLivre.getGenres().getNomGenre());
System.out.println(catCD.getNomCat() + ": " + catCD.getGenres().getNomGenre());
System.out.println(catDVD.getNomCat() + ": " + catDVD.getGenres().getNomGenre());
}
} |