In reply to shanthi:
Thanks for explaining with an example I got your point about why we use $cast.
But, as per the function of copy you have written in the example we have to pass like
…
b1.copy(b2);
…
so it will copy object b2 into b1. But we haven’t initialized b2.
Instead of that, we can write that
…
b2.copy(b1);
…
Then it will copy the b1 object to b2. Am I write?
Once again thank you very much.