BUT2/DEV/DEV3.2/DEV32/2/Exemple.java
2023-12-21 16:36:03 +01:00

50 lines
1.4 KiB
Java

public class Exemple{
/**
* Exemple d'utilisation de SimpleDequeThatsNotCricket.
*
* @param args pas de paramètre en ligne de commande prévu.
*/
public static void main(String[] args) {
MinimalDeque<String> d = new SimpleDequeThatsNotCricket<String>();
System.out.println(d.toString());//
System.out.println("");
String s = "Zo";
System.out.println("addFirst " + s);//
d.addFirst(s);
System.out.println(d.toString());//
s = "Bu";
System.out.println("addFirst " + s);//
d.addFirst(s);
System.out.println(d.toString());//
s = "Ga";
System.out.println("addFirst " + s);//
d.addFirst(s);
System.out.println(d.toString());//
s = "Meu";
System.out.println("addLast " + s);//
d.addLast(s);
System.out.println(d.toString());//gab
System.out.println("");
System.out.println("removeFirst "+d.removeFirst()+", reste");
System.out.println(d.toString());//Ga
System.out.println("removeLast "+d.removeLast()+", reste");
System.out.println(d.toString());//Meu
System.out.println("removeLast "+d.removeLast()+", reste");
System.out.println(d.toString());//Zo
System.out.println("removeFirst "+d.removeFirst()+", reste");
System.out.println(d.toString());//Bu
System.out.println("");
}
}