InterviewSolution
| 1. |
What Will Be The Output Of The Following Code? |
|
Answer» string str1 = "Hello "; The output of the above code is "Hello" and not "Hello C#". This is BCOS, if you create a REFERENCE to a string, and then "modify" the original string, the reference will continue to point to the original OBJECT INSTEAD of the new object that was created when the string was modified. string str1 = "Hello "; The output of the above code is "Hello" and not "Hello C#". This is bcos, if you create a reference to a string, and then "modify" the original string, the reference will continue to point to the original object instead of the new object that was created when the string was modified. |
|