Program gets halted: wait() and notify()
问题 I am trying to achieve this: Created two different threads, one prints odd numbers, one prints even numbers. Once one thread prints a number, it has to wait for the other thread and so on, that is one-after-other. To achieve this, i am using synchronized block along with wait() and notify(). I am creating a class whose's object will be used to pass to synchronized block in both the threads. Here is the code: --> This is used object which will be passed to synchronized block. package com.vipin