25 lines
599 B
Java
25 lines
599 B
Java
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);
|
|
// }
|
|
|
|
}
|
|
|
|
}
|