TP-programmation-orientee-o.../TP13/ChatTest.java

25 lines
599 B
Java
Raw Permalink Normal View History

2023-06-20 19:02:09 +00:00
public class ChatTest {
public static void main(String[] args) {
Chat monChat = new Chat();
Observateur monObservateur = new Observateur();
monChat.addObserver(monObservateur);
Message msg1 = new MessageTexte("moi1", "message1");
Message msg2 = new MessageTexte("moi2", "message2");
Message msg3 = new MessageTexte("moi3", "message3");
monChat.ajouter(msg1);
monChat.ajouter(msg2);
monChat.ajouter(msg3);
// for (Message message : monChat) {
// System.out.println(message);
// }
}
}