It turned out that delegates and events were a difficult topic for me. I analyzed this topic from the book of Shildt, I also read a book by Christian Nagel, Bill Ivien, Jay Glynn, Carly Watson, Morgan Skinner. Some understanding has developed. I want to improve and consolidate my understanding in practice. The search engine did not find me any exercises on this topic. Please help me to come up with training programs that will help me to understand this topic best of all. Exercises should only be related to console programs, since I am not familiar with gui. I will deal with gui later.

    1 answer 1

    Type ping pong:

    • 2 classes Ping and Pong
    • one notifies the other that "ping occurred", the other - that "pong occurred",
    • one pair of objects "play" among themselves, the other pair - among themselves, etc.

    and display corresponding messages on the console, something like this:

    1. Ping received Pong.
    2. Pong received Ping.
    3. Ping received Pong.
    4. Pong received Ping.
    5. Ping received Pong.