I was playing around with RxScala and Subject in scala worksheet. But something weird happened.
as we can see, subscription c also get numbers and output them. After that, I find subscription c is var not val. So, I change the declare. And get following
This one is correct. So, I copy those code to a main function and run it. It is interesting that the output is same with the second picture whether c is val or not.
Why those happend? Program runing in worksheet is different from those after compiling even with the same code?