I'm experimenting with "wait-notify" but it's not working. I want the program to output the text "It's working" whenever I type the letter n in the console. What am I doing wrong? Thanks.
To properly signal between threads you need to synchronize and signal using a shared object. In your sample you have two different Runnable instances each synchronizing and signaling on itself. So neither of the two tasks will see signals from the other one. You need to provide some shared object to signal with.