+ 3
What is difference between string keyword and String Class.
What is difference between string keyword and String Class while using in C#. Which is useful and where ?
2 Answers
+ 1
There's no difference
0
Side note on that, if you save the same string to two variables, the string object will point to the same reference.
String var1= âhiâ
String var2=âhiâ
But if you use the new keyword, youâll have two separate objects pointing to two separate references.
String var1 = âhiâ
Sting var2 = new String (âhiâ )