what happens if instead of int we store string etc in a or b. is optimmisation performed then as well and how. also what would be the range for it
What if instead if integer val we store other type of val
Hey @surbhi11, yes this optimization is done in case of strings as well. Optimization is performed in a similar fashion only, means if two variables store string having same values than their address will be same. In case of strings there is no such range.
Hope this resolved your doubt. 
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.