The difference between line4 and Line 1, Line 2 and Line 3 is that Line 1, Line 2 and Line 3 creates three separate threads of type Reader. All theses threads wait for Calculator thread to notify. Line 4 starts separate thread of type Calculator which notifies all Reader threads. Only problem with this program is that if Calculator thread(line4) starts first (which is very unlikely)Then all Reader threads will wait for ever.
Stop it! You're embarassing me! And you are embarrassing this tiny ad!